David Bryant Copeland
-
Building a Sub-command Ruby CLI with just OptionParser
I’ve thought deeply about building CLIs and built a lot of them over the years. I’ve used Rake, Thor, my own gem GLI and many others. After all that, the venerable OptionParser—part of Ruby’s standard library—is the best choice for scripting and sub-command (git-like) CLIs. I want to show you how. What…
Published
-
Confirmation Dialog with BrutRB, Web Components, and no JS
I created a short (8 minute) screencast on adding a confirmation dialog to form submissions using BrutRB’s bundled Web Components. You don’t have to write any JavaScript, and you can completely control the look and feel with CSS. There’s also a tutorial that does the same thing or, if you are super pressed…
Published
-
Please Create Debuggable Systems
When a system isn’t working, it’s far easier to debug the problem when that system produces good error messages as well as useful diagnostics. Silent failures are sadly the norm, because they are just easier to implement. Systems based on conventions or automatic configuration exacerbate this problem…
Published
-
Build a blog in 15ish Minutes with BrutRB
This is a whirlwind tour of the basics of Brut, where I build a blog from scratch in a bit over 15 minutes. The app is fully tested and even has basic observability as a bonus. The only software you need to install is Docker. Watch on YouTube, if PeerTube isn’t working for you for some reason Check out…
Published
-
Brut: A New Web Framework for Ruby
Brut aims to be a simple, yet fully-featured web framework for Ruby. It's different than other Ruby web frameworks. Brut has no controllers, verbs, or resources. You build pages, forms, and single-action handlers. You write HTML, which is generated on the server. You can write all the JavaScript and…
Published
-
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