December 20, 2013

Dev Toolkit: Code Snippet Storage

The saying goes that good developers write code and great developers steal code*. The best developers however are those who are able to steal from themselves. The great thing about working with digital tools is the ability to apply previous solutions to new work with copy/paste. Reusing code in this manner can save development time is a standard practice, especially for veterans of the industry who get both smarter and lazier as time goes on. What’s hard though is keeping all of your stolen code handy, ready to pop it into the template or script or what have you. Back in the day™ we kept this code around in dozens of text files inside of one or more folders, if you wanted to be fancy about it you might use a spreadsheet instead. The problem with these methods is that finding a particular snippet of code can be an arduous task.

So we need a good tool for keeping our modular code snippets organized, but also for pulling them up at a moment’s notice. Here are a couple of my favorites;

CodeBox

Codebox

Codebox is my defacto code snippet library these days. It’s interface has a few really great features, such as tagging, global search and code highlighting. I use it to store snippets for reference, like PHP’s date formatting syntax (something I forget as soon as I need to echo out a date) or keep my starters – bits of template that I can plug in and modify for the particular site’s data. Pagination, ajax reloads, error logging scripts, csv export functions, etc.

One of my favorite features with codebox is the menu bar item (also invokable via a user-defined keyboard shortcut) that lets me search my library and paste into my editor of choice instantly.

Codebox is available in the App Store for $9.99USD

NVAlt

NVAlt

While I’ve stopped using NVAlt as my code library, I still find myself jumping in and out of it every day. A fork of Notational Velocity, NVAlt is a notepad on steroids that still fits into a size 4. With some work on the user’s part it is possibly the best note taking and retrieval application I’ve ever used. What’s beautiful about NVAlt is the live search bar, just start typing and it will search your entire library of notes for matching terms, and (here’s the magic) if it can’t find what you’re looking for hitting enter will immediately pop your cursor down to the note entry field ready to create a new note in the application. I’ve used NVAlt to store everything from code snippets to server credentials to shopping lists and even a list of which X-Files episodes were included in the canonical myth-arc.

NVAlt is free (as in beer) and can be downloaded directly from it’s author, Bret Terpstra

*A saying that we’ve stolen from the humanities (don’t worry, we’re aware of the redundancy).

Paul Weinert
Author

Paul Weinert is our founder, managing principal and spirit animal. He’s one of those odd people you meet that was born in Portland, grew up here and still lives here for some reason. If you had two words to describe Paul after meeting him, we’d bet you’d use “charmingly quirky”.

Paul started GRAYBOX in February 2009, and for the first four years, GRAYBOX had a blend of a contract staffing firm and a traditional agency. GRAYBOX then hired our first employees in 2012 and has been growing ever since. Professionally, Paul has a background in internet business consulting, working especially with mid-market ecommerce, healthcare, and tech companies. He worked as a user experience designer, web developer and internet marketer. Nowadays, Paul serves as our company visionary, team mentor and head of executive leadership — Paul is extremely proud of the entire team and the company. He’s constantly humbled by the team’s awesomeness and the caring community that’s sprung up from his initial ideas.

Beyond GRAYBOX, Paul is married, has two young boys and lives in NE Portland. He’s also an active foster parent, mentors other local entrepreneurs, and volunteers on local non-profit boards. Businesswise, aside from GRAYBOX, Paul has started a few other businesses and is an active investor in the local startup scene.

For the sheer joy of it, let’s play 2 truths and a lie:

  1. Paul firmly believes that any activity would be better if on a boat.
  2. Other than this whole Internet thing, Paul has basically no other skills or expertise in anything.
  3. Paul is rare unicorn, actually born and raised in Portland.