Just some code I use a lot.