Level Up! at CFCAMP 2013

I shall be speaking at this years CFCAMP to be held in Germering near Munich, Germany on October 14th and 15th this year. The subject is MongoDB and ColdFusion. Here’s the blurb…

Level Up!
Taking your ColdFusion apps to the next level with MongoDB.

The new generation of NoSQL databases offer unprecedented flexibility and ease-of-use when compared to their more traditional, relational rivals.

Discover how adding the powerful features of market-leading NoSQL database MongoDB to your skill set can make your ColdFusion development both more productive and more enjoyable.

My talk is for those ColdFusion developers who just haven’t found the time to delve into exactly what NoSQL in general and MongoDB in particular are all about. A basic understanding of ColdFusion syntax will be useful but no MongoDB experience is necessary.

There are still some CFCAMP tickets available – as always, the sooner you book the less you’ll pay for this great event.



How FourSquare uses MongoDB as their primary datastore

In this 45-minute video, Andrew Erlichson, Vice President of Education at 10gen (the makers of MongoDB) interviews John Hoffman, Manager of the Storage Team at FourSquare, about his company’s use of MongoDB as their primary datastore.

John discusses in detail FourSquare’s evolution from MySQL to Postgres to MongoDB, the challenges that led them to make the transition and goes into some detail about how FourSquare make use of the unique features of MongoDB.

This really is essential viewing for anyone interested in MongoDB and a great insight into what’s involved in managing the data of a high-performance, high usage, web-based app.

As a not totally irrelevant aside, I only recently came across this video as it is made available in Week 7 of the excellent (and free) “MongoDB for Developers” certification training course. For any developer new to MongoDB or just interested in knowing what all the NoSQL/document store excitement is about this is an essential course. Combine it with the “MongoDB for DBAs” course and you’ll come away with a good grasp of what’s involved in switching from a relational to a document-based database.


Generating QR Codes in jQuery with jQuery.qrcode

You might not often need to dynamically generate QR codes in your web app but, when you do, jQuery.qrcode will be a timesaver. Written by Lars Jung, jQuery.qrcode is a wrapper to Kazuhiko Arase’s QR Code Generator.  There is a pure Javascript implementation of the original library so Lars wrapper only really makes sense if you are already using jQuery in your application but, if you are, it greatly simplifies the process.

Using jQuery.qrcode is as simple as including the library and calling it with the required parameters.

<!-- Load the libraries -->
<script src="jquery-1.10.2.js"></script>
<script src="jquery.qrcode.js"></script>

<!-- This is where the generated QR code will appear -->
<div id="img-buffer"></div>

<!-- Now generate the QR code! -->
    render: 'image',
    width: 400,
    height: 400,
    color: '#000000',
    text: 'http://dvolvr.davidwaterston.com',
    ecLevel: 'H',
    bgColor: '#FFFFFF',
    radius: 0.5

The latest release (0.6.0) supports soft, rounded corners and the ability to embed an image or text in the centre of the code. There’s also a new interactive demo page that lets you to try out all the features, to see if the library suits your needs, before you download.

Because I could, I generated the QR code at the bottom of the right-hand sidebar using jQuery.qrcode.


Get Grunting

Grunt Logo

For many web developers, Grunt (a.k.a. “Gruntjs”) – “The Javascript Task Runner” – is an essential part of the development workflow. Through automation, tasks such as linting, minifying and unit testing become automatic and part of the edit-save-edit cycle and not chores carried out after code changes are complete.  With its huge collection of plugins, Grunt can significantly cut the time and effort required to build and maintain quality code.

Unfortunately, as the Grunt website itself points out, “While installing grunt is simple, it’s slightly more involved to get it running on your project”. Having spent numerous hours getting my first Grunt task to work, only to think “is that really all that I needed to do?”, I can certainly vouch for the accuracy of that statement. While the official documentation is constantly being improved it still suffers from taking a “too much too soon” approach, leaving the beginner confused and frustrated as he or she wades through the seemingly endless configuration options.

A simple Grunt run: This job runs in the background each time I save a change, linting, minifying and unit testing.
A typical Grunt run: This job runs in the background each time I save a change and lints, minifies and unit tests.

Thankfully there are a number of great articles out there that strip away the complexity and explain just enough to get the new Grunt-er on the right path. Below I’ve listed six tutorials that I found especially useful when getting started with Grunt. Naturally, there is some overlap in their content but they are all concise enough to read and assimilate quickly and each contributes something valuable.

As you’d expect, these are introductory tutorials and don’t cover all aspects of Grunt. As I was specifically interested in using Grunt to run jsLint, UglifyJS for minification and Karma/Jasmine for testing they tend to reflect that.