In the various programming projects I often work on, there are various levels of logic that I always feel have been done 1000 times before by others, but none the less I'm stuck doing them for the 1001st time.
For example, today I am coding tic tac toe, because I couldn't find source that had a reasonable interface.
The other day it was chess.
There are lots of classes like this, that are too specialized to be included in a library, but are none the less frequently written.
I am wondering if there is some kind of code sharing database or community that shares source for functions that might be reusable by others?
A single function is too small a unit to share and manage; everything basically boils down to copy-paste, which is evil. Separate libraries (in whatever form supported by your environment) represent a much more viable option. Hence, specialized repositories and general-purpose code hosting sites (GitHub, BitBucket, etc) is what you need.
Now, you can raraly find a truly specialized library out there, but you can always start one.