Miscellaneous code that I find useful.