Some code snippets

Just some snippets that I use from time to time, to, well, save time.