Handy code that I use in all of my projects.