Deleting a lot of files (large directory) on linux

While looking for the best option for deleting a LOT of files inside & directory, I came across an interesting blogpost about this subject :

320 and Up – Design boilerplate

A very nice example of a mobile-friendly website : Resize your browser window to see the effect. This site includes boilerplate as well, so it should get you started pretty quickly.

Setting up public key authentication over SSH

I just found a very clear example of creating a public key for ssh access, so check it out if you need to do this yourself :

Setting up public key authentication over SSH – Pete Freitag’s ColdFusion, Java and Web Development Blog

(PS : this works on os-x as well :-) )

Putting jQuery accordion inside tabs

When adding an accordion inside tabs, I noticed that the accordion did not expand as expected. After some trial-and-error, I discovered that you need to create the accordion first, and then the tabs :


This fixed the problem for me.

My new smartphone, iOs or Android ?

Before you start reading this post, please note this is not about which of these is better than the other. It is just a list of criteria on which I based my decision.

A few months ago, my Nokia N900 (with the Maemo OS) broke down, so I was forced to buying a new one. I had thought for a long time that my next phone would be an iPhone (I admit, I’m kind of an Apple fan, although not all the way). I had seen Android in action about two years ago, and I was not at all impressed (it was very slow), but still I decided to take a look at it again. Here are the criteria on which I based my decision.
Read more »

Mysql errno: 150 when creating a foreign key

If you receive a errno; 150 when creating a foreign key in mysql, you may have encountered one of following problems :

  • The type of your foreign key is not the same as the referencing key, e.g. BIGINT -> INT
  • One of the two tables does not have the InnoDB engine. You cannot add foreign keys to MyISAM tables, or referencing MyISAM tables.

If you need more info about the actual error that occured, you can execute following sql statement :


This will show you which foreign key gave the error (or about other errors for that matter) and some more info about possible causes.

Symfony2 – “id” returned as member variable from __sleep() but does not exist

When storing entity objects in the http session, you might run into following exception :

ErrorException: Notice: serialize() [function.serialize]: “id” returned as member variable from __sleep() but does not exist in…

Now, apparently php has some problems serializing an object which subclasses an object with private properties. As Doctrine always creates subclasses of your entity classes (which are called Proxy classes), this means you should never use private properties (e.g. $id or any other property) on your entity (or associated entities) ! Use protected instead.

Custom validation messages for standard validators in Symfony2

Symfony2 contains a lot of validators out of the box, but it is not very clearly documented how to use custom messages when validation fails for these standard validators. After some investigation, I found the validation messages in Symfony/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/translations/. It is very easy to override a message. Just look up the message you wish to modify (e.g. ‘This value should not be blank’), create your own validators.[language].yml file (or .xliff if you prefer) in your bundle, and add this message as a key with your custom message as value :

# validators.en.yml

This value should not be blank: This is a required field

That’s all :)

Using dompdf with UTF-8 encoding

I have used dompdf for the first time to generate PDF files from html content, and it seems to be working pretty well. One thing I noticed, when using UTF-8 encoding, you should add following in the head section of your html content :

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

This way, the characters will be displayed correctly in the rendered pdf.

Xapian queries – a common mistake…

I was just trying to figure out why a Xapian query did not work as expected, when it hit me : i was using the word ‘and’ to combine search terms, while I should be using the capitalized word ‘AND’ instead… Stupid mistake that cost me an hour to figure out. Hence this reminder :)