Category Archives: javascript

Your Old Crappy Code

If you’re not new to software, you’ve probably come across some old code of yours and thought: Oh snap! What is this? What was I thinking? I’ve done it. My friends and colleagues have done. You’ve probably done it as … Continue reading 

| 7 Comments

AutoFixture — a Node.js Test Fixture Library

Working on a recent project that was on the MEAN stack, I needed to create test data quickly. I reviewed and tested out some of the existing libraries that are out there, but none of them fit my specific style. … Continue reading 

| Leave a comment

Reassign JavaScript Function Parameters In Reverse Order, Or Lose Your Params

Every now and then I need to have a method support 2 or 3 arguments, providing a default value for one of them if only 2 are specified. My typical solution is to check the number of arguments passed to … Continue reading 

| 12 Comments

Build A (local) Webcam With WebRTC In Less Than 20 Lines!

WebRTC is all kinds of super ninja epic awesomesauce stuff. If you haven’t looked in to it yet, you’re going to want to get on that soon. I’d suggest starting with the HTML5 Rocks post on getUserMedia. Build Your Own … Continue reading 

| 9 Comments

How I Work Around The require(“../../../../../../../”) Problem In NodeJS

Anyone building a large enough app in NodeJS will tell you that it gets really really really frustrating to have 3 or more lines of this in every module you build: It’s ugly. It’s hard to read. It’s hard to … Continue reading 

| 25 Comments

Taming Callback Hell in Node.js

One of the first things that you’ll hear about Node.js is that it’s async and it uses callbacks everywhere.   In some ways this makes Node.js more complex than your typical runtime, and in some ways it makes it simpler. When … Continue reading 

Also posted in node.js | 1 Comment

JavaScript Promises: A Journey To The “Promise Land”

Promises certainly aren’t the holy grail of asynchronous flow control in JavaScript. There are no silver bullets, after all. Promises are a tremendously important concept, and one that you need to understand, though. They’ve been around for a few years, … Continue reading 

| Leave a comment

Killing Switch Statements With A Registry: An Example And Screencast

In my video on the SOLID principles applied to JavaScript, I showed a quick transformation from using a switch statement to using a registry instead, with the Open-Closed principle as the impetus for moving in that direction. It’s a good … Continue reading 

| 9 Comments

Why WordPress Sucks, and what you can do about it

While great as a CMS, wordpress really sucks as your forward facing production environment. After one week in production with our redesigned wordpress site, we had already racked up 8 hours of downtime due to database failures. Also, we’re paying … Continue reading 

Also posted in aws, node.js, phantom.js, wordpress | 25 Comments

Building An Email List Component With BackboneJS

In my post about re-launching myself in to the independent life, I talked a little bit about restarting my effort to complete my Building Backbone Plugins eBook. I’ve already started down the path, reviewing existing chapters and beginning to fill … Continue reading 

| 5 Comments