Ask HN: What is your favorite website for posting code snippets?

8 points by blairanderson ↗ HN
Its pretty common that I want to save/share a tiny generic chunk of code to be re-used later.

Its typically too small/useless to be packaged, and seems to be about method signatures while switching around languages:

- parsing data

- jekyll helpers

- ruby/js/bash/etc. syntax for reading/writing/appending/etc.

just small junk that I'd like to reference very quickly and help others reference quickly if need be.

I have written and answered my own Stackoverflow question before but it feels stupid so I won't do that anymore. github gists don't often come up in google results and not easily categorized and such.

9 comments

[ 3.1 ms ] story [ 34.2 ms ] thread
gist.github.com

It also integrates well with Sublime Text 3 via a package

(comment deleted)
I use Standard Notes [1] for this. Code editor + sharing lets me do this pretty seamlessly. Actually code snippets is part of the reason I developed this app.

[1] https://standardnotes.org.

Related question: what are people looking for in these tools? Anything feel like it's missing?
Stack overflow is pretty great except people go there when they have a problem and it is majority beginner with minority advanced.

I'd like to see a place that promotes sharing sharing code snippets and curating it.

Almost like https://bootsnipp.com/ but entirely generic for code of different languages

Yes that's interesting. One thing that's always dogged me is that you can't really encapsulate snippets the same you can code.

For instance - it's easy to find a snippet for Quick sort, but if I want to add a user system to an app (something just as standard), that's like 30 snippets and across 4 files and it might not work.