A New Redux Action Pattern for TypeScript 2.4+

In September 2016, I wrote a post about a pattern for strongly typed Redux reducers in TypeScript. Since then, the TypeScript team has been busy enhancing the language, and recent changes in TypeScript have enabled a much more natural, boilerplate-free pattern for strongly typed actions and reducers in TypeScript.
Read more on A New Redux Action Pattern for TypeScript 2.4+…

Using D3 with React and TypeScript

Typically, when working in React, it’s best to split UI elements into separate, reusable parts. This allows for more modular code and finer control over each element.

However, this goes against the way D3 operates, which is to subsequently call dot operators, building up elements and groups of elements.

So how can we utilize D3 in a meaningful way while simultaneously breaking up our elements into individual components? I’m going to show you by working through an example implementing a force graph.
Read more on Using D3 with React and TypeScript…

My Swift Tool Belt (Part 1): Adding a Border, Corner Radius, and Shadow to a UIView with Interface Builder

During my iOS work, I’ve assembled a set of code that I bring with me on every iOS project. I’m not talking about large frameworks or CocoaPods here. These are smaller Swift extensions or control overrides that are applicable to many projects. I think of them as my tool belt.


Read more on My Swift Tool Belt (Part 1): Adding a Border, Corner Radius, and Shadow to a UIView with Interface Builder…

A Brief Introduction to Audio and Video Encoding

Every day, I listen to music or watch videos on different platforms–the radio, phone, computer, and television. Until recently, I had never considered exactly how that media was delivered to me. I would venture to guess that many people have been, or are in, that situation themselves.

I’ve spent some time looking into exactly how these forms of media are created and distributed, and I wanted to share some of the things that I’ve learned. While the concepts themselves aren’t overly challenging, the terminology can be confusing and misused, so I’m going to review some of the common terms and expressions.
Read more on A Brief Introduction to Audio and Video Encoding…

Making Toast from Scratch in React-Redux

Getting UI elements for free is a good feeling. When it comes to popup notifications, other frameworks provide these components for free. For instance, Rails has flashes and Android has snackbars. React is a moving target, so pulling in external libraries can help simplify situations, but it may prevent extensibility later.
Read more on Making Toast from Scratch in React-Redux…

A Quick Android Snackbar Tutorial: Setup, Action Handling, and UI Customization

Android Snackbars are, unfortunately, not as tasty as they sound. But they are extremely useful for showing errors or other lightweight feedback to a user–with minimal setup required. This is a brief tutorial for setting up a basic Snackbar, adding actions, and customizing its appearance.
Read more on A Quick Android Snackbar Tutorial: Setup, Action Handling, and UI Customization…

Using Higher-Order Functions to Build Queries in Knex.js

My team has been using Knex.js to build database queries for our latest project. To create increasingly complex queries, we developed a pattern to generate SQL queries using higher-order functions. I’d like to share how we leverage these higher-order functions to make our query builders modular, concise, and very easy to understand.
Read more on Using Higher-Order Functions to Build Queries in Knex.js…

Ruby Queue Pop with Timeout, v.2 (Correctly Handling Spurious Wakeups)

In one of my previous posts, I wrote a queue implementation that would let you provide a timeout to the pop method. Unfortunately, it has a bug caused by spurious wakeups. Here is the fix along with an explanation of how you can avoid this sort of problem in the future. Read more on Ruby Queue Pop with Timeout, v.2 (Correctly Handling Spurious Wakeups)…