This is a code snippet that I use and reuse in many projects, I thought that it’d be useful to publish it.