loading...

ASK DEV: How are you managing your code snippets

srebalaji profile image Srebalaji Thirumalai ・1 min read

Hey Devs

Do you have a habit of saving code snippets? (I don't). If Yes, comment on your favorite tool to manage your code snippets.

And If No, Tell me why you don't need a snippet manager. Personally, I didn't find a good product to use.

Discussion

pic
Editor guide
Collapse
edwinthinks profile image
Edwin Mak

I haven't lately been creating snippets of code. However, I also haven't found a good snippet manager that works for me and I have used gist.github.com/.

Hope you find something that works well for you.... and then you can share it with me =)

Collapse
optimisticpill profile image
Mishk₰ Rkz

Yep. I love thiscodeworks.com for saving code snippets - maybe because I'm the creator ;). I had the same problem as you and decided to just create a place to store snippets myself. It has project boards and the ability to bookmark other people's code. Am also working on integrating it with Atom and VS Code.

Collapse
spideroxy profile image
spideroxy

Hi Mishky

I like your website. I just registered it. That is an awesome place to store code snippets. It's easy to use.

If you don't mind me suggesting to you - it would be nice if you can add a search feature. If I look for a specific snippet, I have to keep looking till I find it.

Collapse
coreyja profile image
Corey Alexander

I want to use a tool something like pet, but there are a few things about pet specifically that I didn't love and therefor never spent a ton of time getting setup.
It's been a bit since I really got into it, but I believe the few things I didn't love were the fact that gists were the default syncing strategy, and their search was as 'fuzzy' as I would have liked. But I think pet might be an amazing tool for others, just didn't fit my workflow perfectly.

What I actually use is nvalt and have different notes for different 'topics' with different snippets in them. For instance I have a bash note with various different bash snippets I might want.
The reason I don't love this is my snippets are intermingled with other more prose style notes, and I would like to seperate the two. But this works for now until I find the right tool to replace it with!

Collapse
lbonanomi profile image
lbonanomi

Another satisfied user of gist.github.com. I comment them with hashtags and run a chunk of python that indexes gists based on their hashtags and nudges me about duplication of content.

Collapse
vuild profile image
Vuild

I build a website/product & put them all in it for easy access (literally, take the code from a site /app to reuse). Then I know where they go & what they are compatible with. No need for a filing system or organizing.

This won't work in all scenarios but it works for a lot of straightforward stuff.

Collapse
decs_dapp profile image
DECS

Try DECS decentralized application, an all-in-one workspace to manage code snippets and protect sensitive data.

Chrome extension to capture code snippets on the go.
Demo: youtube.com/watch?v=1goz6YAGI5Q

Features:
Security - End-to-end encryption
Modern UI - Search, Share and Embed
Decentralised - Own your data

It's FREE!

Collapse
almarrr profile image
Almar Groenewald

Build my own set of complete page layouts, that contains sections, and those sections contains tiny components. Over the years I build a lot of stuff which I can reuse.

Every piece can be filled with an array of data, so I can get things up and running very quickly.

Collapse
kaosindustries profile image
Kaos-Industries

This all seems quite vague. What technologies are you using to accomplish all this?

Collapse
almarrr profile image
Almar Groenewald

They are all files in folders, grouped in subfolders.

For example, I have a template file in a website homepage:
/sections/footers/footer_1.html

Inside that file are references to other template components:
/components/socialmedia/about_us.html
/components/contact/site_contact_info.html
/components/blog/latest_blog.html
/components/socialmedia/horizontal_bar.html

Those references are requested with a path and json data.

Just a footer example here. In the last years I have build so much stuff for my customers. Menu's, headers, news, blogs, portfolio items, reviews, products, forms, faq, etc, so I can have hundreds of combinations.

I have so much benefits from this and it saves me hours of time.

Collapse
tomlangdon profile image
Thomas Langdon

We use 3cols.com because it is the only thing we have found that lets you store all your content in the cloud and access it from either the web or an app without being painfully slow to load and look through snippets (ahem gists ahem). Another plus is that it lets you share the 'boards' with other developers so our entire dev team is now reading from the same sheet

Collapse
athanasios_nasi profile image
Athanasios Karastogiannis

A good one to try out is called boostNote, they have mac, windows, linux, ios, android, and web clients. It is fully designed for code snippets in mind, and it includes a search, and tag functions. Worth a shot to check out. boostnote.io/

Collapse
artemis profile image
Diane

I use the kickstart tool, written in rust, and to which I contributed a bit, to manage my snippets and code templates.

Collapse
coreyja profile image
Corey Alexander

This looks interesting! Would you mind expanding on how you use this to manage code snippets? From my limiting glance at the README it seemed more focused on creating new projects from templates.

Collapse
artemis profile image
Diane

It basically allows you to create files based on some other file templates, them being full-blown projects or single-files (although it's a tad more bothersome, as you have to have a template.toml file for each template).

I have all of them on a single git repository, that's cloned on my computer, which means that I don't use the git mode but the filesystem mode for snippets.

Thread Thread
coreyja profile image
Corey Alexander

Gotcha that makes sense, thanks for the reply! I'll have to give it a closer look

Collapse
perigk profile image
Periklis Gkolias

I usually have a context, so I just commit them to a relevant repo. If not, I would go for gist.github.com

Collapse
jmervine profile image
Joshua Mervine

I save and fetch gists all using a combination of github.com/mattn/gist-vim and just going to gist.github.com. It’s probably not as efficient as a lot of solutions mentioned.

Collapse
treyog profile image
Shawn Williams

I use Dash, and I'm more than happy with its functionality. I always have the app open and use it frequently as a resource for documentation when coding, so it's easy to remember where all of my personal code snippets are.

Collapse
joel profile image
Joel Krause

I do all the time! Never know when you’ll need them again. For this I use Cacher (cacher.io/). It integrates with VS Code so I can insert/save snippets right from VS Code!

Collapse
romanolester profile image
Lester Romano

right now I'm using snippet store. zerox-dg.github.io/SnippetStoreWeb/

Collapse
srebalaji profile image
Srebalaji Thirumalai Author

Devs

Thank you for your replies. :) I can see that most of the people are using Github gist.

Collapse
mandaputtra profile image
Manda Putra

Browser history,

Collapse
dnn_it profile image
Deepak Naidu

I hear ya!!!!