Coder’s Vacation : Getting Some Names…

Actual Live Status of the NameFactory Project

One of the things I’ve started working on is a #PhatData (re: my renamed version of big data) sample. So far what I’ve created is a JavaScript Application that works something like this. (The actual build status is shown to the right here in the “build status” image)

Step #1: Continuous Integration

The first thing I did was setup a solid node.js project that works on Travis CI (Continuous Integration). This is a pretty quick process. First create a directory and add an appropriate .gitignore and file.

[sourcecode language=”bash”]
$ mkdir NameFactory
$ cd NameFactory/
$ git init
Initialized empty Git repository in /Users/adron/coderz/NameFactory/.git/
$ git remote add origin
$ mate
$ mate .gitignore

The mate command is merely textmate, use whatever you’d like though to create the files. I also use Sublime 2 and other things, textmate just happens to be the poison I often choose from the command line. The .gitignore has the following to take care of WebStorm and other files that might pop up.

[sourcecode language=”bash”]




The I just put the following in. You don’t really need this, but I’m showing you what should be put in a minimal project. In addition to being a good practice, we’ll need the file for plugging in Travis CI in a few steps.

[sourcecode language=”bash”]
Name Factory
Description: This is JavaScript Node.js Project for generating random names.

Commit those files.

[sourcecode language=”bash”]
$ git add -A
$ git commit -m ‘Adding gitignore and’
[master (root-commit) 14b1cf8] Adding gitignore and
2 files changed, 23 insertions(+)
create mode 100644 .gitignore
create mode 100644

Once that is added there are some other files needed for Travis CI that I’ll add before flipping on the actual CI project on the Travis CI Website. First add a .travis.yml file to the project.

[sourcecode language=”ruby”]
language: node_js

# test on two node.js versions: 0.6 and 0.8
– 0.6
– 0.8

The packages file should look like this.

[sourcecode language=”javascript”]
"author": "Adron Hall <>",
"name": "NameFactory",
"description": "A library that creates randomly generated names for insert into various databases.",
"version": "0.0.1",
"homepage": ";,
"main": "./lib/names",
"repository": {
"type": "git",
"url": ""
"scripts": {
"test": "vows –spec"
"engines": {
"node": ">= 0.4"
"dependencies": {},
"devDependencies": {
"vows": "0.6.x"

At this point add a few tests that you know pass. I added the following examples from the vows site (this is the default example on the site).

[sourcecode language=”javascript”]
var vows = require(‘vows’),
assert = require(‘assert’);

// Create a Test Suite
vows.describe(‘Division by Zero’).addBatch({
‘when dividing a number by zero’: {
topic: function () { return 42 / 0 },

‘we get Infinity’: function (topic) {
assert.equal (topic, Infinity);
‘but when dividing zero by zero’: {
topic: function () { return 0 / 0 },

‘we get a value which’: {
‘is not a number’: function (topic) {
assert.isNaN (topic);
‘is not equal to itself’: function (topic) {
assert.notEqual (topic, topic);

…now make sure the tests run ok…

[sourcecode language=”bash”]
$ node test/names_object_should_exist.js
··· ✓ OK » 3 honored (0.003s)

So that’ll get the continuous integration via Travis-CI for NameFactory up and running, with a Github NameFactory Repository that is ready for the name generation code to be added. For my next blog entry I’ll leap into some generation strategies, dig up some good name lists (if you know of any, leave a comment w/ a link), and work on figuring out the fastest way to generate names.

Once that’s done, it’s time to setup some distributed databases.
Shout it