I believe that sooner or later every experienced programmer comes to a conclusion that there is no point in writing frequently used constructions every time from scratch. With this in mind I my self started gathering and maintaining my own code snippets library at some point in time of my career. Every time I meet some programming task - I look into my library first for something I can start from. Every time I write something new - I add it to my library along with some description.
I am more than confident that not I alone do this. May be we should share/merge the "table contents" of our libraries ?
The idea behind the code snippet library is that this makes us more productive programmers after all. The time for programming of typical tasks is decreasing as well as number of bugs we are producing using the well tested code.
Here is my list of snippets (it is rather self explaining but further details can be provided on demand):