DEV Community

Ghost
Ghost

Posted on

Where/how do you save your code snippets?

Latest comments (41)

Collapse
 
nicetr profile image
Osman Erdi Balcıoğlu 🌃

boostnote.io/ is free to use. It looks like cacher.io and snippetlabs but it's free :) Moreover, backed by great community.

Collapse
 
noghte profile image
Saber Soleymani • Edited

I've tried a few of tools mentioned in this thread. cacher.io (former GistBox) is best so far. Its free plan covers all the useful features and it's integrated with gist.github.com.

Collapse
 
chatelao profile image
chatelao

Winword

Collapse
 
ardennl profile image
Arden de Raaij

Github Gists + Cacher App (used to be gistboxapp): cacher.io/

Collapse
 
pavonz profile image
Andrea Pavoni

I use a git repo, I organize snippets in folders named with a given language or topic (it depends). Sometimes are source code files, other times they are in markdown format so that they can be easily read/exported.

I can then share it on github

As of today, it’s the cheapest/easiest way I’ve found.

Collapse
 
janux_de profile image
Jan Mewes • Edited

My code snippets are stored as blog posts in my personal space of our corporate Confluence instance.

Together with the keyword searches of Firefox (or custom search engines for Chrome) this works really well. E.g. I just need to type in "myspace bash parameters" in the address bar. This triggers the Solr based search in Confluence, filtered by my personal space. Then I can click on one of the first entries and copy over a template for the parameter handling into a shell script.

P.S.: The "Add block post" dialog can be stored as a bookmark.

Collapse
 
nrobinson2000 profile image
Nathan Robinson

In my ~/projects folder, as a Gist, or on GitHub.

Here is my most recent snippet:
github.com/nrobinson2000/particle-...

Often my snippets turn into full projects.

Collapse
 
gearloosejones profile image
Gearloose Jones

Anything I find super-useful gets tossed into my public GitHub.

Collapse
 
cheshireswift profile image
☕ツ

I don't, really. Any code that is useful I've either written myself for a project (in which case I check the source for the project), written myself for a one-shot script or similar (in which case I save the script) or found elsewhere (in which case I bookmark the elsewhere).

Anything too small to justify the effort of those, I'll probably just type out each time, not worth the interruption in flow to do otherwise.

Collapse
 
kapouer profile image
Jérémy Lal

gnome-gpaste is amazingly useful during the day - and doesn't require using the mouse.
Otherwise all code stays in projects:

  • very useful code goes into a npm module
  • (debian) server configurations tricks goes into a private github repository
  • credentials into a cryptfs partition
  • casual code stays where it's used - in its own git repository
Collapse
 
adambrandizzi profile image
Adam Brandizzi

To copy and paste? Nowhere, I always go back to the main source code. If I need a snippet many times in a row, my clipboard manager can handle it.

For sharing I use pastebin.com because I like the classics 😁

Collapse
 
peiche profile image
Paul

Google Keep if it's something I just need to hang onto for a little while.
OneNote for work stuff.
CodePen for front-end stuff, especially when I'm working out a little block of functionality that needs testing.

Collapse
 
david_ojeda profile image
David Ojeda

We store snippets/small scripts on Basecamp 3 since we like to keep as most things as possible in one single place. Really helps not switching between 10+ services.

Collapse
 
rdeavila profile image
Rodrigo de Avila

I use Github Gists to public things (and some scripts I want to execute using curl commands), and a private gitlab.com repo (full of scripts/markdown files) for private ones.

Collapse
 
akmur profile image
Alex Muraro 🇪🇺

I use Evernote, the beta version has a basic code formatting feature. However it's just for reference and study, not for the workflow.