Code snippets

This is a collection of code snippets I've used and saved in the past.