hello.js

var please = require('share');
console.log('thank you');

Tuesday, 19 February, 2019 UTC

Wrapping a TypeScript Function for Background Execution

Wrapping a TypeScript Function for Background Execution

In my last post, I showed how to write a higher-order function that could wrap an existing function without losing the original function’s types. Today, I’m going to show how you can use that same technique to wrap an existing function for a different ... more


Wednesday, 13 February, 2019 UTC

An Introduction to React Native Testing with Cavy

An Introduction to React Native Testing with Cavy

I’ve recently been using Cavy to handle end-to-end testing for a React Native app. In this post, I’ll go over some first impressions and a few patterns I’ve found to be helpful. Intro to Cavy Cavy is an end-to-end testing framework that integrates with ... more


Tuesday, 5 February, 2019 UTC

Four Ways to Refactor for Easier Development

Four Ways to Refactor for Easier Development

Refactoring isn’t just about optimization or replacing some ugly code with something more elegant. It’s also a chance to keep things organized and consistent, which: Helps new team members understand things better. Helps everyone contribute faster because ... more


Tuesday, 5 February, 2019 UTC

Creating a Local File Cache Inside Your React Native App

Creating a Local File Cache Inside Your React Native App

I recently had to implement a local file cache for a React Native app so that users could play audio and video when offline. There are a number of reasons you might need to make a similar caching system, and this post explains how to set up the basic ... more


Friday, 1 February, 2019 UTC

Replacing Heroku Review Apps on Non-GitHub Projects

Replacing Heroku Review Apps on Non-GitHub Projects

If your software team develops multiple new features simultaneously, you need to be able to deploy and test them in isolation. The gold standard for this is to use Heroku’s review apps, which are temporary environments automatically spun up for each ... more


Thursday, 31 January, 2019 UTC

Using React Storybook to Tackle Complex Multipart Stories

Using React Storybook to Tackle Complex Multipart Stories

Often, when developing a new React component for a web app, I find myself with lots to do. For example, I may need to add a Redux container, API endpoint, some Redux actions, and the UI of the component. These tasks are all interconnected and interdependent, ... more


Monday, 21 January, 2019 UTC

Type-Driven Development – Replacing Unit Tests with Types in Typescript

Type-Driven Development – Replacing Unit Tests with Types in Typescript

Being explicit about the return type of the function is the most under-utilized feature of TypeScript. At least, that’s true for the way I write my code. When I first started using TypeScript, I was really impressed with the way it inferred the return ... more


Saturday, 19 January, 2019 UTC

Project-Specific Command Line Shortcuts with direnv

Project-Specific Command Line Shortcuts with direnv

Most projects that last more than a few weeks accumulate some form or another of automation. Some carefully craft jobs in a package.json file and run them with yarn automation . Some stuff their Makefile s full of .PHONY targets and run them with make ... more


Wednesday, 9 January, 2019 UTC

Creating Amplify Email Campaigns in JavaScript

Creating Amplify Email Campaigns in JavaScript

On my current project, we are using AWS Amplify to manage cloud infrastructure. One of the reasons we’re using Amplify is to send targeted emails to our users through AWS’s analytics tool, Pinpoint. Setting up an email channel through Amplify turned ... more


Friday, 28 December, 2018 UTC

Improve Your App with CSS in JavaScript

Improve Your App with CSS in JavaScript

I’m bootstrapping a web project for the first time in a while, and I was surprised to find that CSS-in-JavaScript libraries are now a thing. Despite my initial surprise, I’ve come to believe it’s actually a great idea. What is CSS-in-JS? Unlike me, you ... more


Friday, 21 December, 2018 UTC

A Simple Way To Quickly Animate SVGs with Vivus.js

A Simple Way To Quickly Animate SVGs with Vivus.js

Creating thoughtful, handcrafted animations is not something we get to do on our projects very often. When faced with tight deadlines and budgets, building out the core feature base has to be our top priority, so there’s not much time to devote to simply ... more


Thursday, 13 December, 2018 UTC

Collection Operations on Lazy Sequences in TypeScript with itiriri

Collection Operations on Lazy Sequences in TypeScript with itiriri

I’m currently working in TypeScript after spending a lot of time in F#, and I’ve been experimenting with adapting my favored functional approaches to the former. Recently, an Exercism.io puzzle called for iterating over a grid. A year ago, I would have ... more


Thursday, 6 December, 2018 UTC

Setting up a Test FTP Server in Node

Setting up a Test FTP Server in Node

On a recent project, I had a need to create an FTP connection to a third-party server. Since we had no control over the server, I also wanted to setup a test FTP server that I could use to run our client against to make sure we could connect successfully. ... more


Wednesday, 28 November, 2018 UTC

Generating Excel Files using Node.js and ExcelJS

Generating Excel Files using Node.js and ExcelJS

Recently, I was tasked with writing some code to generate Excel workbooks containing sales data. I implemented the code using a Node module called ExcelJS. I found that this module provides a simple interface to generating documents, and it also supports ... more


Wednesday, 28 November, 2018 UTC

An Approach to Database Testing in .NET Core 2.1

An Approach to Database Testing in .NET Core 2.1

I’ve been working on a REST API written in ASP.NET Core 2.1. Recently, our team wanted to write tests that exercised our business logic and also interacted with our database. I wasn’t able to find many examples of this online, so I was motivated to write ... more


Monday, 26 November, 2018 UTC

Why You Should Avoid Writing Complex SQL Queries – and What to Do Instead

Why You Should Avoid Writing Complex SQL Queries – and What to Do Instead

If you’ve worked with a piece of software that talks to a database, chances are you’ve come across a long SQL query. Slowly, your eyes glaze over as you attempt to reason through the many joins and subqueries, trying to figure out if this query is the ... more


Sunday, 18 November, 2018 UTC

Creating Custom CloudWatch Alarms for AWS Lambdas

Creating Custom CloudWatch Alarms for AWS Lambdas

AWS allows you to setup CloudWatch alarms on many performance-related metrics. Doing this for metrics like CPU load or storage use is trivial. However, setting up custom alarms based on events or errors in a log isn’t as straightforward. By the end of ... more


Thursday, 15 November, 2018 UTC

Pattern Matching without Regex! – Introducing the Rosie Pattern Language

Pattern Matching without Regex! – Introducing the Rosie Pattern Language

Recently, I was able to attend Jamie Jenning’s talk on the Rosie Pattern Language (RPL/“Rosie”) at Strange Loop 2018. I had not previously been aware of Rosie, but after learning about it, I am extremely excited about the prospect of never writing another ... more


Wednesday, 7 November, 2018 UTC

A Case Against Dependencies

A Case Against Dependencies

When you need to add a major bit of functionality to your system, what’s the first thing you do? Naturally, you start looking through whatever package repository is appropriate for a solution that fits. While there’s nothing inherently wrong with this, ... more


Tuesday, 6 November, 2018 UTC

Using an Int Type in TypeScript

Using an Int Type in TypeScript

The project I’m working on has a Node.js back end written in TypeScript, with a PostgreSQL database for persistence. We had a production user who encountered an error when the system tried to insert a row into a table that had an integer column in it. ... more


Saturday, 20 October, 2018 UTC

Running QBASIC in a Browser – My Nostalgic Trip Back to the 1990s

Running QBASIC in a Browser – My Nostalgic Trip Back to the 1990s

Recently, I saw Windows 95 running under Electron. The project definitely brought up some old memories from when I was young and new to computers in the mid-1990s. Back then, I spent all of my time outside of school learning how to write code in BASIC. ... more


Monday, 8 October, 2018 UTC

Fake or Mock an API with JSON Server

Fake or Mock an API with JSON Server

JSON Server is an easy and quick-to-set-up module that you can use to fake or mock an API. You can find the basics in the documentation, and many articles regurgitate the same info. In this post, though, I intend to cover a few of the more complex things ... more


Tuesday, 2 October, 2018 UTC

Getting Started with WebSockets

Getting Started with WebSockets

WebSockets are a useful tool that allow for two-way communication between a web server and a browser. In this post, I am going to introduce the basics of WebSockets by making a (very) simple chat application using Express, HTML, and vanilla JavaScript. ... more


Monday, 1 October, 2018 UTC

Compressing 3D Model Files with Draco

Compressing 3D Model Files with Draco

Historically used for CAD and video games, 3D computer models are working their way into the mainstream. This is, in part, due to the rise in popularity of things like augmented reality and 3D printing. My current project uses 3D model data, and my team ... more


Thursday, 20 September, 2018 UTC

Reactive Programming: A Timed Popup Component with RxJS

Reactive Programming: A Timed Popup Component with RxJS

Reactive programming is all about streams. It involves combining streams, filtering streams, and transforming streams. In reactive programming, the application does not need to pull for data, but it is notified whenever a new event occurs. A few months ... more


Tuesday, 18 September, 2018 UTC

Building a Fake API for Testing & Development

Building a Fake API for Testing & Development

Nearly all applications developed today will integrate with an external service of some kind (HTTP, Bluetooth, etc.). These integrations can pose problems for automated testing, exploratory testing, and even demonstrating functionality to a stakeholder. ... more


Thursday, 13 September, 2018 UTC

Creating a Drag-and-Drop File Uploader with React & TypeScript

Creating a Drag-and-Drop File Uploader with React & TypeScript

A while ago, I was working on a project based off the Atomic SPA Starter Kit, which uses TypeScript, React, and GraphQL. One of the features we needed to build was a file upload component that supported dragging and dropping a file from a separate window ... more


Monday, 10 September, 2018 UTC

Correctly Managing Concurrency in JavaScript

Correctly Managing Concurrency in JavaScript

More times than I can count, I’ve found myself needing better concurrency primitives in JavaScript (or TypeScript) applications. Almost anything you might need is possible using the Promise API, but promises are complex, and there are many subtleties ... more


Wednesday, 5 September, 2018 UTC

Four Hurdles when Prototyping with Material-UI for React

Four Hurdles when Prototyping with Material-UI for React

Google created the Material Design design language to be used across devices. If you’re using Material Design with React, I’d recommend Material-UI for React to get the ball rolling. It’s a library of components or pre-styled elements (similar to the ... more


Thursday, 30 August, 2018 UTC

Intro to Swagger – A Structured Approach to Creating an API

Intro to Swagger – A Structured Approach to Creating an API

Creating an API can be difficult when starting from scratch. And working with a team on determining the structure and testing an API can further complicate the process. Swagger can help this process move more smoothly. In case you’re not familiar with ... more