You are correct that you should:
- Assert Copyright
- Grant people explicit rights to use, modify and distribute your code.
In many places, the idea of public domain is not recognized. In order for someone to be able to (legally) use your code, there must be something that says that they can, and under what conditions. For snippets, I highly recommend the 3 clause BSD style license. It asserts your copyright, tells people that they are free to do whatever they like with the code, so long as they preserve your copyright when distributing it via source and tells them that they can't use your name to endorse derived works of the code without your permission.
The GPL has very specific definitions of what should happen when you combine GPL covered work with something else. The GPL has to prevail as the dominate license in the code base, which means someone using your snippets inherits the GPL. The LGPL (known as the library GPL, or lesser GPL) is more suited for that, because it allows linking without inheriting the license. Still, if you're going to take the teeth out of the GPL, you might as well use a much simpler license.
Another excellent choice would be the MIT license, which is very similar to the three clause BSD style license.
Finally, if you must use the GPL, please indicate "Version 2 or later" if at all possible. This ensures that your code can work in places where a tree might be using "Version 2 Only", which is quite common. A substantial portion of the Linux kernel specifies version 2 only, GPL3 (while widely accepted) was met with a fair amount of criticism and rejection.
I'm not discounting the importance, significance or usefulness of the GPL. I'm just suggesting that it might not be the best choice for snippets and libraries.
Near the beginning of every file there should be a copyright notice and the following statement (change Foobar to your program's name):
This file is part of Foobar.
Foobar is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
You should also include a copy of the full license text somewhere in the distribution of your program.
http://www.gnu.org/licenses/gpl-howto.en.html
Apparently, 3 line classes are no exception...
Best Answer
As long as you are the author you are eligible to write a copyright notice that states that you are the copyright holder, you don't have to redirect the copyright to anyone else. I suggest you check out this page on how to use GPL.
This is what is generally written in GPL'd source code files: