How to rename local/remote branch in GIT

The first step is to checkout to branch which we want to rename and then:

To delete the old branch type this in terminal:


PHP – reads text file without new line character

If you’re trying to read text file with file() function (or something similar) and it returns file content without new line recognition probably php configuration is set to not detect line endings. To avoid this (if anything else does not solve your problem) you can use ini_set() in your PHP script – as follow:

This should do the trick.

Remove DL element from form

When displaying form in Zend Framework, it wraps form elements with <dl> tags. To avoid this situations (for example to use custom decorators for elements) we can reset form decorators and set theme like this (init() function of form class):

This should do the trick.

Tagging in GIT

In git repositories we can use tagging functionality to mark a point in history. Usually developers use this feature to mark new release version of their projects. To simply add new tag just use this code:

It will tag repository with ‘v1.1.0’. We can also use tagging with additional comment:

To list all available tags in history use just:



How To – SSL self signed certificate

Install OpenSSL

To properly set up SSL self-signed certificate we need openssl library. To check if we have it already installed (on Linux and Mac OS) simply input this command in terminal

If it returns something like this:

we can go further and create certificate. In other way we have to install openssl library. For different systems we can do the following:

Create SSL certificate

To properly create SSL certificate just input in your terminal following commands

And now we can create our certificate using server.key and server.csr files


Learn X in Y minutes

Creating new project from scratch very often forces us to choose proper technology – we can use wide range of programing languages and frameworks so sometimes we have to learn new programming language syntax fast. It doesn’t have to be a big pain – maybe we have to just visit this site: It contains very fast introduction to many programming languages with its syntax, commonly used methods or code blocks. It is a good, quick knowledge base to get started with new technology.

Moving WordPress to another domain

If there is a need to move WordPress installation to another domain or move it from production to localhost, launching of copied files and database will not work. Posts stored in database and some wp options contains information about domain name, so dynamic links will redirect to unknown pages. To fix this, after copying database and necessary files to new domain, just simply replace mentioned entries directly in MySql using sql commands.

For wp_options table in Your WordPress:

For wp_posts table in Your WordPress:

Those changes should properly set new domain and make it work.

This is not the only way to move WordPress – contains detailed information about moving to another location.

Also there is a very usefull tool to search and replace domain entries in database without using any sql command. This tool is available here: Search And Replace Tool. It’s a single script file which can be use not only with WordPress.