Category Archives: JavaScript

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 

| 8 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 

| 18 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 

| Leave a 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 

| 8 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 

| Leave a comment

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

An Epic Report/Dashboard With Keen.io And Kendo UI DataViz

A while back, I wrote a post on the idea of a minimum viable report – basically, just using simple NodeJS files that I run from the command line and console.log stuff out so that I can see the information … Continue reading 

| 2 Comments

SOLID JavaScript In A Wobbly World (Wide Web)

I got to speak at CodeMash 2014, and gave a talk on applying the SOLID software principles to JavaScript. In addition to giving the talk, though, I also recorded the session and have published the video with all the resources!  … Continue reading 

| Leave a comment