Code from my StackOverflow answers.
All my original contributions to StackOverflow are hereby placed into the public domain. If this is not legally possible, then anyone receiving a copy of them by any means is granted a non-exclusive perpetual license to use, distribute and modify them, and to distribute modifications, under any license or none, with or without attribution.
Please note that this license applies only to my original contributions - quoted material and edits by me to existing material on StackOverflow are derived works and I'm not at liberty to grant rights in them. [lifted from Steve Jessop's about me, thanks!]