A gem for code sharing was launched about a month ago on OpenNTF, XSnippets. It contains small re-usable chunks of code related to Xpages.
The UI is very simple and userfriendly and finding that codefragment you need in your next project should not be a problem. The code snippets are even colour coded.
Hopefully all those great contributors of code to the Notes Domino community will gradually copy their pieces of code to this site. That would make XSnippets the place to look first and avoid reinventing the wheel.