Miscellaneous C++ code I find myself writing over and over again.