For Clients
For Geeks
Git sync/fetch remote branches

In: Git Snippet no: 166

To synchronise all remote branches with local version in git, all you need to do is run following commands: for remote in `git branch -r`; do git branch –track $remote; done git fetch –all git pull –all Thanks Wookie88 for answer on stackoverflow and TL;DR version.

Read snippet

We all have our small and big WordPress projects. Sometimes we want to allow our clients to see what has been done so far, but we don’t want anybody else to see it. The easiest way to define this is: prevent access for users which are not logged in WordPress administration. Sure – you can […]

Read snippet

Sometimes we and/or our customers want to remove price changes from product options and have them display only on change on our price label in Magento. For configurable products, prices are added to label from js module Product.Config. To remove them, we have to rewrite module’s function getOptionLabel. We need a new javascript file, inside js folder, […]

Read snippet

Sometimes you just want to ignore changes you made locally and have the same situation you have on your git remote server. It is a simple thing to do, but don’t forget you will delete all the changes you have made locally before running this command.

Read snippet

It is not usual to show the number of the published post, however, it is not necessarily a bad thing. Sometimes, we just don’t publish on daily or weekly basis and this “published” date might make our posts look outdated. Therefore, we can build a simple procedure which will tell us how many of this […]

Read snippet

Assuming that we have column A containing first and last name with a potential middle name, we can assume that taking first name can be conducted by getting the value from beginning until first space.

Read snippet

We often need to list randomly chosen products on our Magento store. Lucky for us, Magento has provided this functionality, and this is easy to achieve from CMS block or CMS page. All we need to do is choose a category from which we’d like to list our products, and use following snippet in that […]

Read snippet

Page 1 of 2112345...1020...Last »