Following is list of Apex/Visualforce code samples listed on Salesforce Wiki. These are collections of pieces of code that you think will be useful to us (Salesforce community). These are typically small (a few pages of Apex, or Apex and a few Visualforce pages, or a trigger or two) and one-off.

If you want to instead create or join a collaborative coding project, check out Salesforce Code Share

Source : Salesforce Wiki