views:

175

answers:

7

I've done consulting work for years and I've got code snippets in various languages lying around that I'll re-use for various projects. The collection is getting pretty large and I want to set up a code bank for myself.

What code banks do people use? Do you find it helps, or is there some better way of organising my reusable code snippets?

(If one does exist, I'd prefer it be open-source, accessible via a web browser, language-agnostic, and maybe colour the code the way Stackoverflow does :)

+1  A: 

You should see how the sites "Google Code", "Sourceforge", etc. maintain their code bank. Are you looking something similar to that then hire a web designer.

Manav MN
If one already exists, I'll use it, but if I can't find one that suits, I'll just write one. It wouldn't be difficult, but I don't want to re-invent the wheel.
calico-cat
+2  A: 

I use a simple ones like snipt.

If you want an opensource ones you can try cab, which is used by djangosnippets.

jpartogi
Thanks! I'll give it a try.
calico-cat
Upon further inspection, it seems to be online only. I have several valuable pieces of code and algorithms that I don't want to store anywhere but on my own server. There isn't an open-source version I could pop on my Linux box, is there? ;)
calico-cat
Yes there is. Try cab.
jpartogi
Thank you! Cab is exactly what I was looking for! Have an upvote and a green tick!
calico-cat
+3  A: 

How about using a private wiki?

Brian Ensink
A: 

Snipplr.com is one I use

fuzzy lollipop
+1  A: 

Supposing you're using some version control system Trac would let you browse it, and with pygments on the same machine, highlight it, too.

Note that Trac works with a wide variety of version control systems...not just SVN, and it comes prepackaged with a wiki, which can handle syntax highlighting. There's a number of great project management plugins, too -- so it could end up helping to organize your contracting work.

Mark E
A: 

github.com could be useful.

Yeti
A: 

I recommended Snippets at this question.

shennyg