DEV Community

Ghost
Ghost

Posted on

Where/how do you save your code snippets?

Top comments (41)

Collapse
 
armangungor profile image
Arman Gungor

Check out Quiver for Mac by HappenApps. Lets you mix text, code, Markdown and LaTeX. You can edit your code with ACE with syntax highlighting, etc.

--
Arman Gungor
Metaspike

Collapse
 
ben profile image
Ben Halpern

I've been on the fence about Quiver, I should just try the free trial already.

Collapse
 
nunez_giovanni profile image
Giovanni Nunez

I never log-in to comment, but felt like it was necessary :p

I love Quiver. Besides the stuff Arman mentioned, I love having a defined view for all my data.
I gave each language it’s own “notebook” and I use the tag feature that’s built in.

Collapse
 
t4rzsan profile image
Jakob Christensen

BitBucket.org has a "Snippets" feature where you can save any code snippet you want. Their web UI has code highlighting and they keep your code in Git. The snippet can be private or public.

Similarly, GitHub has "Gists".

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
 
jwmorse17 profile image
Joshua Morse

I have tried so many. I want three main things: first I want a web app, I am switching between multiple Win/Linux/MacOS machines multiple times a week and I want syncing and I don't want to deal with OS dependencies. second, want syntax highlighting, and last robust search. Quiver is amazing but is only Mac, Evernote doesn't have great highlighting, onenote kinda sucks in general. I have been using InkDrop recently. It does not have a web app, but it does sync across platforms.

medleytext.net/ is supposed to release a web app in July '17, so that is the next thing I am going to try.

Right now I just have a mess of notes in a few different platforms waiting for the right app. At this point I would pay good money for the right solution.

Collapse
 
jacobwallenberg profile image
Jacob Wallenberg

Sounds like you've thought quite a bit about this problem Joshua. Are you on MedleyText now? How are you finding it?

Collapse
 
dean profile image
dean

I love using Github's Gists. IntelliJ also has a way to upload a code snippet to a gist from within the IDE, which is an extremely useful feature! Great syntax highlighting support as well, and has edit history.

Collapse
 
josegonz321 profile image
Jose Gonzalez • Edited

GitHub Gist has worked wonders for me.

This is where I parked all my snippets. :)

F#:

JavaScript:

Elm:

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
 
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
 
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
 
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.