DEV Community

Cover image for I Built an Open-Source Code Snippet Collection
Bruno
Bruno

Posted on • Originally published at itsbruno.dev

48 6 7 4 12

I Built an Open-Source Code Snippet Collection

If you've ever found yourself repeatedly Googling the same code snippets, then SnipNest is something you'll find very useful. It's a place to share snippets with ease.


Why SnipNest?

The idea for SnipNest came from my own frustrations. As a developer, I often need quick solutions to problems I've solved a dozen times before. While there are plenty of resources out there, I didn't find one that would fit my preference. I wanted a structured, easy-to-use, and searchable collection of snippets. That's how SnipNest was born.


The Journey So Far

Building this project has been a challenge. I explored multiple storage options (e.g., databases, JSON, etc.) and landed on using MDX files. Each snippet is stored as a file containing metadata (name, description, keywords, and contributors) alongside the actual code of the snippet with an example of how to use it. This makes it straightforward to contribute while keeping the content well-organized. Though later I might explore using plain markdown files.

A big part of the experience was working with Next.js and shadcn/ui with Tailwind CSS. I was pleasantly surprised by how quickly I could spin up a prototype. Next.js been my go-to React framework, and using it for SnipNest confirmed that Next.js is still my favorite. I came across little to no issues during development.

To make SnipNest even more accessible, I've released a Visual Studio Code extension. With this extension, developers are able to browse, search, and insert snippets directly into their code editor.

The core idea is simplicity. To submit a snippet, contributors fork the project, add their snippet, and open a pull request.


How You Can Help

I can't do this alone! There are countless snippets out there, and I need your help to make SnipNest grow in useful code.

If you've written a useful snippet before — utility, helper function, or anything you think may help others — consider contributing. Your snippets could save someone hours of debugging and searching.


Get Involved


A Big Thank You

To everyone who has inspired or supported me to make this idea come to life. A special thanks to those who have starred the repository, it really helps me stay motivated to continue improving and growing SnipNest!

I'd love to hear your thoughts and feedback.

— Bruno

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (19)

Collapse
 
jak5fd0000234775 profile image
Jacqui Hall

This is a great concept! I currently use an extension but in my browser, it would be better to use with a vscode extension. I can't wait till I get to take a better look!

Collapse
 
kingrayhan profile image
King Rayhan

Nice and simple UI, I love it. However if you could make it database centric instead of git-based, this would be more helpful.

Collapse
 
itsbrunodev profile image
Bruno

Thank you so much for the feedback! I'm glad you like the UI.

I opted for a git-based approach because I believe most developers are already comfortable with it. That said, you're absolutely right that a database-centric approach could make the platform more accessible and user-friendly, especially for those who prefer not to work with Git.

In fact, I've already considered adding this in the future. While I feel that a project at this scale doesn't necessarily need it right now, I definitely see the value it could add as SnipNest grows.

Collapse
 
itsmeseb profile image
sebkolind

This looks awesome! I added a snippet 🙌🏻

Collapse
 
itsbrunodev profile image
Bruno

Thank you so much, it means a lot!

Collapse
 
suvojimodak profile image
Suvojit Modak

Great App 👍👍

Collapse
 
itsbrunodev profile image
Bruno

Thank you!

Collapse
 
sudo_091 profile image
TechTales.io

Nice Idea GG!! Keep it up

Collapse
 
itsbrunodev profile image
Bruno

Thanks!

Collapse
 
respect17 profile image
Kudzai Murimi

Great Job!

Collapse
 
itsbrunodev profile image
Bruno

Thank you!

Collapse
 
leonardo_machado_d0c7e2c0 profile image
Leonardo Machado

Github Gist (gist.github.com) provides a similar feature, but it is not Open Source. You can get some ideas from it (like forking an snippet).
Being open source is nice. Good job!

Collapse
 
itsbrunodev profile image
Bruno

Thanks for the feedback! I think I understand, are you suggesting users could fork a snippet, like how GitHub Gist allows forking and modifying content? Let me know if that's what you meant! 🙌

Collapse
 
adridev24 profile image
Adrian

Oooh I like this app, very helpful 🔥

Collapse
 
itsbrunodev profile image
Bruno

Thanks a ton! I'm so glad you find it helpful, that's exactly what I was aiming for. 🔥

Collapse
 
linkerin profile image
Alexei

Have you checked snipshot.dev? It has been around for 2 years.

Collapse
 
itsbrunodev profile image
Bruno • Edited

Thank you for bringing up snipshot.dev, I hadn’t heard of it before! One key difference I see is that SnipNest is open-source, whereas Snipshot takes an account-based approach, which is also a nice model.

edit: I later realized that Snipshot is also open-source, great work on building such a platform! It's inspiring to see others having similar ideas. Keep it up!

Collapse
 
planke profile image
Peter Planke

Great share!

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay