various pieces of code used by many of my projects