Random code that I've written over the years, kept for posterity.