Code Collector Pro: Store, Backup & Share Your Code

It’s nice to be able to memorize multiple lines of code, and I applaud you if you’re able to do so. For others like me, though, remembering every different snippet of code can be a challenge. You could always refer to your 300-page programming book, but that’s a lengthy process to repeat on a regular basis.

Wouldn’t it be great to have a library of your most important code snippets always available on your Mac? If the answer is yes, Code Collector Pro could be a good solution. In this article, we are going to take a detailed look at Code Collector Pro and it’s companion web application, codecollector.net.

What is it all about?

Code Collector Pro is a simplistic app that offers a straightforward method to store commonly used code snippets, and provide easy access to them. Not only that, this app syncs with CodeCollector.net -an online storage area to share your codes with other users.

Interface

As a Cocoa app, Code Collector Pro offers a native Leopard look-and-feel. Doesn’t it look simple? Well, it is.

The Interface

The Interface

One thing I dislike about other apps is an excess of toolbar clutter. Code Collector Pro keeps it clean. This way, you’re free to focus on the core functionality of the app. Everything else can be accessed through the “options” button in the bottom left:

Options

Options

Usability

If you’re a keyboard shortcut fanatic, Code Collector Pro will be very much up your street. Most actions can be easily assigned a quick shortcut combination. In “preferences”, you can also set up the default font, show/hide line numbers and the background color just like in XCode. As for syntax highlighting, it uses TextMate bundles to differentiate the syntax from one language to another.

Highlighting

Highlighting

Some bonus points are given to Code Collector Pro because they let the developers set up the types of licenses for codes. Defining licenses is actually a very important practice that amateur developers seem to often overlook.

Search Panel

This is my favorite feature in Code Collector Pro. It’s called the “Search Panel”. To set it up, go to “Preferences” and in “General”, you’ll find “Search Panel Hotkey”. By default it is Control + G.

Keyboard Shortcut

Keyboard Shortcut

In Code Collector Pro, add a new snippet, CMD + N. Type in the code, I used “<li><a href=”#”></a></li>”. Rename the title to what you would use for its shortcut. Mine is “csl” which stands for “CSS Sprites <li>”. Once you got the snippet ready. Go back to your code editor, I use DashCode, and type the search panel hotkey you assigned earlier (remember it was CONTROL + G). After you’ve done so, the “Search Panel” will pop up listing all your snippets:

Quick Search

Quick Search

Now, here, I want to add an <li> attribute to add another menu to my dropdown menu after “Dating”.

To avoid scrolling down to “csl”, I’ll type it in the search box. Once Code Collector Pro has found it, I hit Enter and it will expand the code assigned to that title, as shown below:

There is an advantage of having to type the hotkey prior to typing the code snippet title. That is, you wouldn’t have to worry about mixing up between wanting to type a code snippet or a regular word.

Smart Groups & Tagging

A great feature built-in to OS X is that of “Smart Folders”, or “Smart Groups”. It allows you to create dynamic folders in which contents satisfy the conditions given to the folder. Code Collector Pro creates them in a similar way to iPhoto and iTunes, thus, you don’t need to readjust or learn a new technique

Now, I would like to collect my CSS snippets together in one folder but I don’t want to waste time drag and dropping them myself. We can do that by clicking the gear icon on the bottom left and selecting “New Smart Group”.

Give the folder any kinds of conditions you’d like and all snippets that fulfill those conditions will be thrown in there right away. With “Smart Groups”, you’ll be able to browse your snippets faster.

Smart Grouping

Smart Grouping

Code Collector Pro lets you tag your codes through the Inspector window. Tags can also be used to assign conditions to your “Smart Groups”.

CodeCollector.net

Have you used a similar code organizing app in the past, but lost all your snippets because you forgot to back them up? Well, here’s some good news, Code Collector Pro can sync with CodeCollector.net, its online repository for paid users.

You can choose which snippets to upload; your whole “Library” or just the folders you select. Uploading snippets occurs in the background, and syncing is automatic.

Uploading and Sharing Your Own Codes

In order to upload your snippets to CodeCollector.net and let others see them, you need to make an account first. You can do that by going to “Preferences” > “Sharing” then clicking “Get an Account”.

You will see next 5 text fields you’d need to fill in – registration occurs directly within the app, not requiring you to visit an external site.

Registering

Registering

Next, you need to enable “Sharing”. You can go to “Preferences” > “Sharing” then tick the “Enable Sharing” box. You can now choose whether to upload all your snippets, your “Library” or only certain folders.

Any folders being shared are over-layed with a small green “wireless” icon to let you know that it is publicly available.

Interface

The interface of the site is fairly minimalistic. On the homepage, since we’ve just uploaded some snippets a couple of minutes ago, we can see they appear under the “Latest” list. You can also find the “Popular” list which is a tad useless since most of the users don’t delete the default snippets. As a result, the most popular snippets are the default snippets.

The most useful component of CodeCollector.net is probably how you can view uploaded snippets without even being a member.

Let’s search for a code snippet to create rounded corners with CSS. We’ll see that CodeCollector.net gives us a list of all snippets containing the word “rounded” in them:

Searching Online

Searching Online

Now, it looks like the second result is closest to what I’m looking for. Let’s click on that to see more of the snippet, then select to send it to our own desktop with the “send to Code Collector” option:

Send to Code Collector

Send to Code Collector

As you would expect, it automatically stores that snippet into your personal Code Collector Pro library.

If you open up the Inspector window for this snippet, you’ll see there is a link to the original snippet we found on CodeCollector.net (very useful when wanting to give credit to the original author).

Conclusion

For me, the quick search panel is the main selling point Code Collector Pro and you’ll love it. There are other similar alternatives, but nothing beats the interface and simplicity found in this app.

Additionally, being able to upload all your code snippets to CodeCollector.net is just fantastic. You could use it for backup purposes, or for sharing code for a particular project so your other team members can see the changes.

The tool needn’t be used only for code, but can be suited for any word or phrase. You could add a snippet that contains “in my opinion” and name the title as “imo”, thus, when you search for “imo” in the Search Panel, it will paste the full snippet when you hit Enter. You could also add the infamous “Lorem Ipsum” dummy text into Code Collector Pro. The possibilities are almost endless!

Nevertheless, there have a couple of bugs with Code Collector Pro on Snow Leopard. Often, when switching between Spaces, the Spaces grid remains on screen and my keyboard stops working. I haven’t found a direct solution for this either. I’ve tried restarting the computer but once I launch Code Collector Pro for a few minutes, I experience the same situation. In addition, the “Popular” list on CodeCollector.net could be improved by excluding the default snippets in Code Collector Pro.

All in all, it’s a great app and I hope it will be useful for you! I know I’ll be using it for a while, and hopefully the small niggles will be fixed in due course.


  • http://twitter.com/aziz_light Aziz Light

    I downloaded and bought this application a long time ago. Since then it was updated three times and there was absolutely no improvement. There are a couple applications to manage code snippets on OS X, they all absolutely suck, but this one, which by the way is one of the only non-free ones, is the worse. This application has potential that it doesn’t exploit, instead it’s broken. The syntax highlighting is…well bad. However there is the possibility to use Textmate bundles for syntax highlighting. When I bought the app, it just didn’t work, now when I try the app crashes. It seems like it’s getting worse.

    Now I’m gonna be objective. If this application was free, it would be…ok, not good, just ok (and I’m being nice). But this app costs 20 euros which is almost $30, that’s a ripoff, especially considering the fact that there are other free apps that do the same, are more stable and have better syntax highlighting. The two better solutions would be Snippet (http://fuelcollective.com/snippet), that I kind of like but not love, and Snippely, the adobe AIR app, that wasn’t updated since it was created. All in all, there are absolutely no good snippet management application on mac; my dream is that either someone prove me wrong or that Code Collector Pro becomes a good app.

    Meanwhile my advice would be to use Snipplr which is an amazing free web service that has a ruby command line client, a Textmate bundle and an API if you want to create your own client (plus you can insert Snipplr snippets directly in any wordpress blog, yes there is a plugin)

  • http://inspiredbywordpress.co.uk Daniel Groves

    Awesome, downloaded the demo and loving it!

  • http://inspiredbywordpress.co.uk Daniel Groves

    Awesome! Downloaded the Demo and loving it!

  • http://www.grantlucas.com grant

    The spaces bug you describe isn’t limited to code collector. I do not have this program install and I get the same error often. I am not sure what causes. Putting your computer to sleep and waking it up again seems to resolve the issue till it happens again.

    • http://kaypearl.posterous.com Kay

      Yes, I need to clarify this.

      It’s not a bug that only happens in CCP but it’s a Snow Leopard bug, more specifically, it’s a bug related to System Events in AppleScripts.

  • http://www.nouveller.com/ Benjamin Reid

    This looks really good! Good use of LittleSnapper too. I’m undecided though, Snipplr is okay. Maybe I’ll make a code library for myself.

  • http://blog.1530technologies.com Griffin

    Gotta agree with Aziz. This app is brutal. Give Snippet a shot if you’re looking for something slick and usable. It even syncs your snippets w/ MobileMe if you work on multiple computers.

  • Chris Gaines

    Anything like this for a Windows environment?

    • Chris Gaines

      I just found a Windows alternative called Code Collector from DNJ (www.dnjcompany.com). It backs up,too and can be taken with you on a USB drive.

      The UI is nothing fancy, but it works.

      It is also FREE.

      Still, not as awesome as Code Collector Pro for the Mac.

  • http://maxikey.de Maxi

    Sounds useful.

  • Pingback: Win a Code Collector Pro License – Mac.AppStorm

  • Drew Reece

    It has lots of potential but two successive updates broke the data store.

  • Someguy

    http://www.snippetsapp.com/

    The Icon is terrible though.

theatre-aglow
theatre-aglow
theatre-aglow
theatre-aglow