David Bryant Copeland
-
Neovim and LSP Servers Working with Docker-based Development
Working on an update to my Docker-based Dev Environment Book, I realized it would be important to show how to get an LSP server worker inside Docker. And I have! And it’s not that easy, but wasn’t that hard, either. It hits a lot of my limits of Neovim knowledge, but hopefully fellow Vim users will find…
Published
-
One Week With Desktop Linux After a 20 Year Absence
I bought a Framework laptop a couple weeks ago, set it up with stock Ubuntu, and used it for my primary computer for a week. It’s the first time I’ve used Linux in earnest in 20 years. It’s amazing how much has changed and how much hasn’t. The tl;dr for this post is that I don’t know if I could use Linux…
Published
-
A Simple Explanation of Postgres' Timestamp with Time Zone
Postgres provides two ways to store a timestamp: TIMESTAMP and TIMESTAMP WITH TIME ZONE (or timestamptz). I’ve always recommended using the later, as it alleviates all confusion about time zones. Let’s see why. What is a “time stamp”? The terms “date”, “time”, “datetime”, “calendar”, and “timestamp”…
Published
-
Custom Elements Reacting to Changes
In the end notes of my post on creating a sorting and filter table using custom elements, I mentioned that my solution would not work if the inside was modified. This post outlines how to address that using MutationObserver, and it’s kinda gnarly. The Problem - Your DOM Changes out From Under You The…
Published
-
HTML Web Components Re-Use Logic, Which is What You Want
Custom elements that wrap HTML (AKA “HTML Web Components”) can be extremely useful for re-using logic without requiring the user of the custom element to adopt any particular UI or styling. And this is usually the sort of re-use you actually want. Let me demonstrate by creating a way to sort and filter…
Published
-
Achieve Static Typing Benefits in Ruby with Keywords Args and Class Constants
Noel Rappin wrote an article on static typing in Ruby that does a great job outlining the various techniques to achieve the benefits often ascribed to static typing. I have two more techniques that address the 80% case of typing problems in Ruby: keyword arguments and class constants. In my experience…
Published
-
Create public-facing unique keys alongside your primary keys
Peter Shilling wrote a blog post about generating what he calls “cool ids” for models in Rails. Instead of numbers, models have an id prefixed with its type, like cus_abcdefg1234 for a customer. I like the idea, but don’t think these ids should be used as primary keys. External IDs are incredibly useful…
Published
-
Three Good and Three Bad Things about Docker
I could use Docker, but didn’t understand it until I wrote Sustainable Dev Environments with Docker and Bash. While I was expecting to kind hate it, there’s actually some really cood stuff about Docker and its ecosystem. But yeah, there’s some crap, too. To end on a high note, I’ll start with one of…
Published
-
Estimates are Fine. They Build Trust When You Provide Them And Deliver On Them
Marco Rogers asked about estimates on Mastodon, and I agree with a lot of what he’s written. Engineers often think they should not have to do estimates, going so far as to champion the “no estimates” movement, or claiming that engineers should not have to be accountable for their work. Writing software…
Published
-
Ruby's Complex Branching Options
Working on some personal projects where I’m not constrained by older versions of Ruby or on Rails, I’ve been trying to learn and use features of Ruby introduced in the last few years. One feature is pattern-matching, and it’s caused me to ask the question: what is the best way to create a branching control…
Published