Is there some sort of Evernote for code? I'd love to be able to save small pieces of code with some accompanying documentation that describes how it works.
Ask HN: How do you keep track of small pieces of useful code?
1–10 of 30 posts
Re: Ask HN: How do you keep track of small pieces of useful code?
#2very often a "remark" or a non compiling comment is included in the source code snippet.
e.g.
rem "this code does nothing"
let i=1
for i=0
beep
else end
alternate functionalities may written as a "remark" and copypasted or edited to make it a compiling line of code so that you can quickly edit the source code and not have to type so much, or go looking through a codesnippit database to find the tool you need...
the actual source code script , depends of course on what language you are using, i chose a pseudo BASIC bcz , well its basic...Re: Ask HN: How do you keep track of small pieces of useful code?
#3GitHub gists
Re: Ask HN: How do you keep track of small pieces of useful code?
#4I have a utilities library that I constantly expand and reference it in all projects.
Re: Ask HN: How do you keep track of small pieces of useful code?
#5Start a folder (or even a single file) for code snippets. If you want it accessible on many machines, put it in Dropbox, or a Github repo, or whatever you like. A separate "Evernote for code" is the last thing you need.
Personally, I have "snippets.org" file in my "wiki/" subfolder on Dropbox.
Re: Ask HN: How do you keep track of small pieces of useful code?
#6I use both Gitlab snippets and a repository with a mkdocs website.
Re: Ask HN: How do you keep track of small pieces of useful code?
#7If you are on a Mac, you could try Quiver. It's a general purpose note taking app aimed at developers that handles code via Markdown. You can then tag and orgnaise everything. I use it along with Notability on iPad (for hand written stuff)
Re: Ask HN: How do you keep track of small pieces of useful code?
#8I have a whole directory tree ~/useful/{scripts,snippets,values}/ etc.
Re: Ask HN: How do you keep track of small pieces of useful code?
#9In my zim-wiki Computer directory, I have a page called 0_Quickies.
Re: Ask HN: How do you keep track of small pieces of useful code?
#10I have many code snippets, whih I keep either on Box Sync or Drive depending on platform. Would be happy to share them! Would you be interested?
I'd definitely be interested in peeking at/copying other snippets too.