Code Bank

code view
Screenshot of Build 20111227

Having problems with the button above? Try downloading the installer directly.

Code Bank was built out of my need for a good snippet management system some where to store my most common and reusable classes or snippets. I've looked into existing ones and never found one that I liked or had the features I wanted. Many get the job done, but have a rather clunky interface and for that matter ugly. Since I originally released it well over a year ago now, Code Bank has become my most successful application with 400+ installs.

When Code Bank is first launched the Server Select screen is displayed, similar to that of the MySQL GUI Tools. The server select screen remembers all of the previous servers, but only the ones which a successful connection to the server and successful login is made. The first thing Code Bank does when you hit the login button is the connection attempt to see if the server address is correct, then a login attempt is made. If the user successfully connects and authenticates to the server the application transitions to the main screen.

The main screen is where 90% of the action happens, from there you can search snippets based on title, description, or tags. You can select snippets which are categorized based on languages and they will be displayed to the right with full syntax highlighting thanks to SyntaxHighlighter. When a snippet is displayed all of the information about that snippet is also displayed, this is information like the creator, last modifier, when it was last modified, as well as it's title and description. Once a snippet is displayed you have the ability to copy, export, print, edit and even delete the snippet right from the main screen. Possibly one of the most important and most useful features is also displayed on this screen, the revision dropdown.

Code Bank has a rather simple implementation of a version control style system, each time a change is made to a snippet that version is added to the database while the old version is kept. This in effect gives you the ability to see the previous versions of a snippet and do all the functionality you could with the "head revision" except for editing that revision. This feature steams from my use of subversion for personal projects and at work and how much I value it as a development tool. Code Bank even has a compare view allowing you to compare between revisions of a snippet of code which is available with both a server and local database.

Code Bank has full support for a local database, with all the features of using a server for storing the database minus only a few features. One of which is user authentication which frankly didn't really need to be used in a local database, only reason it's there in the server model is so that users have their name bound to their submissions. The other is the Intellectual Property notice feature again something that is not really needed in a local database.

With the release of 2.0 I added only few new features and tweaks to many existing, the largest and most complex change to Code Bank's source was adding support for multiple languages using my i18n library. I also added away to clean up your server history, since somewhere around version 1.3 I added support for database updates Code Bank no longer deletes the database containing the server history every time a new release comes out when 2.0 was released  it added the ability to remove individual entries from the server list.

Many users requested that there be away to get around the session time out, prior to 2.0 if your session timed out you would get bumped back to the login screen and everything you were looking at gets reset back as if the application just opened. In 2.0 when your session expires a dialog appears asking you to enter the password for the logged in user once the password is entered correctly the user is returned to where they left off. Of course with a local database this does not apply the user is simply left logged in until the application is closed. In the future I plan to have it setup so that the user can enable a heartbeat of sorts, so every 10-15 min a request would be sent to the server to keep the session alive. If the session has expired then the current dialog would be presented asking the user to re-enter their password.

When I released 3.0 I added several other things, including support for snippet packages, folders in languages, hidden languages, and more. Pretty much all based on user feedback and again my own want's and needs. As well I largely re-wrote the serverside/web client which is now a module for the powerful SilverStripe 3.1 Framework which has largely become my bread and butter for development. I guess when you use it every day at work you start to really enjoy working with it ;). For more information on the server side/web client, head over to the Code Bank page in my PHP works. When I released 3.0 I moved over to using the SilverStripe 3.1 Framework, so I figured giving it it's own page would be better than summing it up here.