January 20, 2017

Loading State Trick for Stateless Functional Components in React

I want to share with you a little trick I've been using lately with stateless functional components in React. This is probably really old news to some of you, but I'm hoping there are a few of you who don't know this one yet. If you're getting started with React, and especially if you're using Redux…

JavaScriptWeb Development
December 03, 2016

IMHO: Avoid Clever Code

or Code is for Humans, Not for Computers

Yesterday, I was poring through some code when I came across a pattern I hadn't seen used in JavaScript before. The pattern looked like this: This pattern takes advantage of how logical operators work. In the case of && , when the left side is true, the runtime evaluates the right side. Since an…

December 01, 2016

How To Use Client Side Libraries in a Universal JavaScript App

At work, I am building a JavaScript application with universal rendering. There are a number of challenges with building a universally rendered application, but one challenge in particular is making sure code that should only run on the client doesn't cause the server to crash. Today, I built a…

November 16, 2016

State Snapshots in Redux

Redux is a predictable state container for JavaScript apps. I've been using it in all of my apps recently and I discovered an elegant and clever use of it that I want to share. The rest of this article assumes you know how to use Redux. If you do not, follow the link above and read up before…

July 02, 2016

Componentize Gem

or Bringing Components to Rails Projects.

In my last few Rails projects, I have been exploring strategies to create and utilize "components" similar to how components are used in Ember. Rails doesn't have a simple, native way to do this. However, I think I've come up with a good way to accomplish this, and I have created a gem to facilitate…

Web Development
June 18, 2016

How to Prevent a User from Editing a Profile That Isn't Theirs in Ember

or How to Keep Mischievous Users Out of the Cookie Jar

I was working on Tempo the other night and ran into a pretty common situation I wasn't sure how to solve right away. I had created profile pages for my users and given them the option to edit their profile. However, I needed to make sure that a user couldn't edit a profile that wasn't theirs…