Every now and then I'll run across a useful code snippet that I think will be good to tuck away...