csvfaker - Generate CSV files from the command line

csvfaker is a command line tool to generate sample CSV files using Faker.

To install it, run:
$ pip install csvfaker

Best Chrome extensions for Web Developers

Drupal guide for developers

It's still very short, but a few months ago I started a Drupal guide: Drupal 7 guide for Professional Developers.

Although it's a very personal, biased document, it's also a wiki that anyone can edit and improve.

Adding JavaScript and CSS to every page in Drupal without using hook_init()

The problem of adding css or javascript inside a hook_init() implementation, is that the hook is called during _drupal_bootstrap_full(), and will run in cases where we are not delivering HTML (such as AJAX requests). Even if this does not have any visible effect, as the html is never outputted in these requests, it unnecessarily penalises them.

Update a field without saving the full node in Drupal

JavaScript type checks

Looking for the difference between typeof variable === 'function' and jQuery.isFunction() I found this useful table for checking JavaScript types:

Optimizing media for the web: PNG images

PNG images, like other media formats, can be compressed in two different ways: Lossy and Lossless.

jQuery.cookie in Drupal 7

Apparently it's not documented, but Drupal core includes the jQuery.cookie library.

The most useful drush commands

Here I will try to maintain a drush cheat sheet with the list of drush commands I use most often. Full and short version of commands are used interchangeably.

How to get the IP address from the command line

Using OpenDNS:

dig @resolver1.opendns.com myip.opendns.com +short 'hostname' | head -1