Random code scraps I keep using.