Building a Blog with Metalsmith

Metalsmith is a new addition to static site generator space, only released at the beginning of this year. It's written in JavaScript and provides an extremely simple plugin system for composing files using middleware. The fact that everything is a plugin makes it incredibly easy to understand what…

Avoid type="number" in AngularJS

The other day I got hit by a peculiar bug in Angular. Using type="number" on an input element wouldn't do any number validation. On top of this, when I entered an invalid number the only validation failing was required. After a little research, it turned out to be a "feature" of blocking access to…

Introducing Retest

If you've looked into testing your API in node before, you've probably run across supertest by the prolific TJ Holowaychuk. So have I and it's truly a fantastic library for testing APIs. However, I found it to be lacking a couple of features I sorely needed. And to my surprise, I struggled to find…

Enabling Generators in Mocha

Update: It's on npm. Just npm install co-mocha and --require co-mocha in your mocha script to test using generators. For the last week, I've been working on a new project that uses node 0.11 and generators. Aside from the numerous benefits with generators in the application, I also integrated…

Partial Application in JavaScript

Partial application is the act of pre-filling arguments of a function and returning a new function of smaller arity. The returned function can be called with additional parameters and in JavaScript, the this context can also be changed when called. Using a partially applied function is extremely…