Some utility code bits I find useful from time to time