Jan 1, 2021

Objectives for 2021

Happy New Year! 2020 was very different than what I was expecting. Even with COVID-19 and its craziness, I’m glad I managed to get through 2020 relatively stress-free. I think the books about resilience I mentioned in my objectives for 2020 post helped with that.

Here are my objectives for 2021, regardless of what kind of year it’ll be.

Keep reading→

Sep 29, 2020

Common Table Expressions

I use WITH clauses in SQL queries a lot these days. WITH is a keyword associated with common table expressions (CTEs). CTEs allow you to temporarily use the results of one query as a table in other queries.

You use them like this:

WITH cte AS (SELECT ...)

When would you want to use CTEs? One case is when you want to use a subquery, that you’re already using as a column, as a WHERE condition. Here’s an example that uses a schema inspired by GitHub issues.

Keep reading→

Aug 20, 2020

Apple Watch Uses

Two years ago I didn’t want to get an Apple Watch. I wanted a Fitbit Alta HR because I had an older Alta without heart rate monitoring, and that was the only feature I really wanted.

The Fitbit tracked my steps and sleep, alerted me to calls, texts, and calendar events. I thought if I add heart rate monitoring then I’d be getting pretty much the same capabilities as an Apple Watch. So I ordered a Fitbit Alta HR on Amazon.

Immediately after ordering the Fitbit I started reading more about the Apple Watch and, well, started rethinking my decision. Anyway, the Fitbit got lost during shipping and I took it as a sign and ordered an Apple Watch instead 😅.

Keep reading→

Aug 13, 2020

What are my popular posts like?

I’ve been blogging for almost a decade now 😯. I like looking at my Google Analytics data every once in a while to see what content gets the most views. Some posts are more popular than others (regardless of when they were published), so I highlight them as top posts.

I didn’t know those posts would be popular when I wrote them. I wouldn’t even say they’re all my best work. But they’re popular and I wanted to understand why – or at least understand some of the similarities.

As of August 13 2020, the most popular posts on this blog in the past 28 days are:

  1. Recovering MySQL replication after error 1236
  2. List of Time Series Databases
  3. Optimizing Concurrent Map Access in Go
  4. Using Ansible with GitHub Actions
  5. Faster MySQL replication with group commit and delay

Occasionally Using libuv with C++ makes the top 5, but apparently not this time.

All of those posts are solutions to problems I had. They are the results of hours (or days!) of research and/or problem solving. For example, the TSDB list started off as a research task at work. We were looking for something that could replace MySQL for time series, and after hours of research I ended up with a list of various TSDBs and short notes about each of them. I just published that list. The rest of the posts are short posts with bits of code showing how to do something. They’re all straightforward, not very complicated, and didn’t take a long time to write. The actual writing part didn’t take a long time, but getting the actual content did.

It took me a long time to get to these solutions because I couldn’t find the answer anywhere else, so I had to figure things out on my own. Once I got something working I published a post, mainly as a reference for myself. Clearly they’re useful for others too. For example, I think I wrote the first post about using Ansible with GitHub Actions, and now it’s one of the top Google results when you search for something like “github actions ansible”. Never expected that!

I think these posts are popular because I’m not the only one who encountered these problems, but I may be one of the first to write about the solutions. If something takes me a few hours to figure out, then hopefully writing a post will bring that down to minutes for someone else, including myself in the future.

What I got from this brief analysis is this:

  • If something takes you more than a couple of hours to figure out, it’ll make a good post.
  • The bar for good, interesting content is lower than you think. This is a good thing! No need to gatekeep content that you don’t think is good enough. Keep writing.

With that in mind, I don’t think I’ll ever run out of blog post content. 🙂

Jun 15, 2020

Dark theme

I added a dark theme to this blog over the weekend. Here’s how you can do something similar with just a few CSS updates.

The first thing I did was move all color codes to variables. This is useful in general so you can define colors once and reuse them instead of copying and pasting color codes everywhere.

:root {
  --main-bg-color: white;
  --main-fg-color: black;
  --date-fg-color: #c0c0c0;
  --border-color: #eee;

Those are the only 4 colors I use. Next, I updated styles to reference those variables, like this:

.mf-header-nav-links a {
  color: var(--main-fg-color);

I also had to add rules for things that assumed certain defaults, like the body text color and background:

body {
  color: var(--main-fg-color);
  background-color: var(--main-bg-color);

Finally, I added a media selector for dark color scheme preferences. All it does is update the variables I defined earlier.

@media (prefers-color-scheme: dark) {
  :root {
    --main-bg-color: black;
    --main-fg-color: white;
    --date-fg-color: #888;
    --border-color: #333;

And that’s it! It only took a few minutes to do. All of the websites I have created recently use CSS variables and the prefers-color-scheme media selector because they’re so useful.

Apr 28, 2020


I have a new project! It’s called ReadFaster.app. I’m launching it May 1, 2020.

When I usually talk about my projects, I’m either thinking about starting something or already have something in progress. This time is different: I’m already done!


I started this project for Startup School. I needed something to build and decided to work on something I’ve wanted for a while.1 Plus this idea is simple enough to implement that it gave me time to focus on other aspects.

This project was more about the process and execution, and less about the idea itself. It was my first time taking the Startup School course, attending group sessions, getting feedback about the idea, and talking to users… all before writing a single line of code. Usually I start with code 🙃. I learned a lot this way, like how to really focus on the problem and the why.

I did most of the implementation in the last couple of weeks. It was a nice way of taking advantage of all of the free time I have during this COVID-19 pandemic.

Here are some implementation details. I did a few new things this time:

  • Go API
  • Preact UI (first time using Preact instead of Mithril.js)
  • PostgreSQL (not my own K-V store this time, phew!)
  • Docker containers on a DigitalOcean droplet
  • CloudFront (CDN for everything, including APIs!)
  • Built using GitHub Actions
  • Deployed using Ansible in a GitHub Action

Now that this is all done… I should to get back to reading 😂.

  1. I was using my old Transverse project for this use case but it was a poor experience.