Miscellaneous code snippets for common use.