~$ cd /var/www/your-site-folder/wp-content/ ~$ svn export http://i18n.svn.wordpress.org/tools/trunk/ makepot ~$ cd plugins/your-plugin-folder/languages ~$ php /var/www/your-site-folder/wp-content/makepot/makepot.php wp-plugin ../ With the last option you need to specify if you are creating a POT for a plugin or for a theme (for themes, use “wp-theme” instead of “wp-plugin”) and the last command line parameter is the plugin/theme folder (in this case ../ is pointing […]

To selectively merge files from one branch into another branch, run where: branchX is the branch you want to merge from into the current branch The –no-commit option will stage the files that have been merged by Git without actually committing them. This will give you the opportunity to modify the merged files however you want to and then commit […]

What follows is a small tip to create an extension of the base “text” widget of WordPress, to allow the execution of shortcodes and to allow to specify one or more classes (space separated) per-widget. In this way it will be really simple identify the widget in our CSS. The class is really simple to manage and extend (if you […]

The default Drupal “search by user” is performed by the hook search_execute implemented by the user module (here is the full code), which searches on the “name” field (if you can administer users it searches also on the email). But what about searching on other fields? As a user is an entity on Drupal 7, it can be extended with […]

After playing around with ab (apache benchmark) in a test server, I’ve found particulary annoying that with this simple tool I could break this test server. The problem is that a server have a limitate number of resources (CPU/RAM) and for that reason is not possible to accept too many concurrent requests from the same source. This is the base […]

Sometimes you need to handle custom sliders and you also need to listen for the user click event. This is the code I eventually used, perfectible (surely), but it seems to do its job very well. The really important parts are those in which you need to set the interval and the timeout, as well as those in which you […]

Fail2Ban is a really good piece of software that allows to understand when someone (a bot) is trying to offend your server using a brute force attack. Let’s say that you don’t want to apply a permanent ban as a default rule (because it is possibile, setting the bantime at -1 in the relative filter of the jail.conf file). Let’s […]

Have you set up a cool faceted search and you want to use an accordion menu to offer a better visualization behaviour? To accomplish this task there are different ways, but the ones which works for me out of the box are these: Standard accordion behaviour Multi-opened Accordion (thanks to supersuphot for the multi-accordion version – see this stackoverflow question). […]

It was January 2002 when the “king of all browsers” had the largest market share: 86%. After 10 years, the dictatorship is permanently collapsed, with only 16% of utilization. Considering that only 7-8% have IE8 (IE9 works pretty good) we are talking of a very small percentage of users, but this percentage is even more than the usage of Safari and Opera togheter; […]

I’ve forked a cool gist code, made by klangley here, to allow a more reasonable number of database backups using the Amazon S3 storage webservice. My forked version is available here: https://gist.github.com/4107260 and allows a rotating daily backup and a rotating weekly backup: in this way you’ll have 4-5 weekly backups (one for each week of the month) and 6 daily backups (one for […]

One of the last works in which I’m involved is the creation of a webserver to handle a dozen of websites. This task can be done in different ways: you can grab the best and pay many (many many) dollars or you can try to understand what is the best way to accomplish it. I prefer the second solution. So, […]