Develop in Docker: Node.js, Express, & PostgreSQL on Heroku

This post builds on the excellent tutorial from Tania Rascia: Create and Deploy a Node.js, Express, & PostgreSQL REST API. I want to build a little web app that can store some data! …without installing anything new on my computer. Here’s how to configure VSCode Remote Containers to do that. Installed on my machine: Docker …

Read moreDevelop in Docker: Node.js, Express, & PostgreSQL on Heroku

Honeycomb in Rails with separate dev and production events

Honeycomb made it suuuuuper easy to see traces of HTTP requests hitting my app. Right from my computer! We installed one gem, did one rails generate from a cut-and-paste their dataset creation page gave me. Start up rails server, hit http://localhost:3000, and boom! A thing on a graph in Honeycomb! That was cool. Except, um, …

Read moreHoneycomb in Rails with separate dev and production events

Honeycomb in Rails without hard-coding the API key

Today we hooked up Honeycomb to an app for the first time! It was easy and fun! Then we configured it so that we don’t have to commit our apikey. It’s a public repo. Anyone could grab our API key and send spurious events to our Honeycomb datasets, screwing up our information and costing us …

Read moreHoneycomb in Rails without hard-coding the API key

Read a file with promises in TypeScript on Node

import * as fs from “fs”; import { promisify } from “util”; const content: Promise<string> = promisify(fs.readFile)(“path/to/the/file”, { encoding: “UTF-8” }) I am tired of looking that up over and over every time I want to read a file into a promise in Node using TypeScript, so here it is. Next time, bring me here, Google. The promisify call turns fs.readFile from a callback-based method to a promise-based one. promisify accepts …

Read moreRead a file with promises in TypeScript on Node

Leverage as baggage

We want to maximize the impact of our work, right? Help all the teams, not just ours. Widely applied processes, reusable code. Watch out: imposing reuse invites regret and resentment. Reuse is coupling In code: this one time, the lead devs at my small company made a utility library, full of little array and string …

Read moreLeverage as baggage

Control doesn’t mean you know what’s going to happen

Being prepared includes…* Controlling the flow of the interview* Allowing uninterrupted dialogue* Keeping an open mind* Following the facts wherever they may lead Luizzo and Gaspar, “Demystifying the Investigative Process” in PI Magazine “Control the flow” and “Follow the facts wherever” seems contradictory. Do I make the interview go according to plan, or do I …

Read moreControl doesn’t mean you know what’s going to happen

One Secret to Quality Software

They ask us for quality. What is “quality”? “Well, free of defects.” (Oh it’s a lot more than that.) What is a “defect”? “Well, when it doesn’t work like we expect it to. Like we agreed it should.” Trust me, you didn’t specify how it works. That’s my job, as a developer. To organize all …

Read moreOne Secret to Quality Software