You Wouldn't Understand

TL;DR Err on the side of believing someone who has experienced something you haven't, even if you initially disagree with it. Knowing vs. Understanding The "Smarter Every Day" YouTube Channel released a remarkable video, The Backwards Bicycle. It features a bicycle with a gear that reverses the action of…

The ReactJS Controller View Pattern

TL;DR Making a top level component that holds all state and passes it to children as props is really nice. Not to be confused with MVC, a "view controller" or "controller view" is a top level component that holds all state and passes it to children as props. For…

How to use ES6 in NodeJS

WARNING: This post is out of date. This method shouldn't be used in production and if you're using Babel 6, this won't work at all. TL;DR require('babel/register'); at app entry point. The Backstory While converting an app from Rails to Node, I searched for how to use…

How to Copy Only Changed Files With Gulp

Recently I had to keep two folders in sync with gulp. I needed to copy all files from one folder to another, and keep them up to date when changes were made. The easy way is just to copy the entire folder every time. gulp.task('watch-folder', function() { gulp.watch(…

How to Debug Mocha Tests With Chrome

This post assumes you're familiar with Chrome's developer tools. Take That, WebStorm! I've long lamented that Vim will never have IDE style debugging, which is more powerful than any Vim feature. Until… I was browsing the Mocha documentation on a whim while waiting patiently for death, when I came across…

How To Set Up Devise AJAX Authentication With Rails 4.0

For whatever reason, there are several blog posts on how to accomplish this, and they all get it completely wrong. If you've found this page, I sincerely hope you haven't had to experience those. Learn from my pain. Devise can almost do this out of the box. We just have…