Recent Snippets

2024-12-16: 20 days of ruby gems: part 1

2024-12-02: My MacOS setup for hacking on CRuby

2024-11-28: Counting C method calls in CRuby

2024-11-27: My docker setup for hacking on CRuby

2024-11-26: Calculating the largest known prime in Ruby

Ruby methods are colorless

👋🏼 This is part of series on concurrency, parallelism and asynchronous programming in Ruby. It’s a deep dive, so it’s divided into 12 main parts: Your Ruby programs are always multi-threaded: Part 1 Your Ruby programs are always multi-threaded: Part 2 Consistent, request-local state Ruby methods …

Your Ruby programs are always multi-threaded: Part 2

👋🏼 This is a series on concurrency, parallelism and asynchronous programming in Ruby. It’s a deep dive, so it’s divided into 12 main parts: Your Ruby programs are always multi-threaded: Part 1 Your Ruby programs are always multi-threaded: Part 2 Consistent, request-local state Ruby methods are …

Your Ruby programs are always multi-threaded: Part 1

👋🏼 This is a series on concurrency, parallelism and asynchronous programming in Ruby. It’s a deep dive, so it’s divided into 12 main parts: Your Ruby programs are always multi-threaded: Part 1 Your Ruby programs are always multi-threaded: Part 2 Consistent, request-local state Ruby methods are …

PgBouncer is useful, important, and fraught with peril

Updated 2024-09-17 to reflect updated PgBouncer support for protocol-level prepared statements 🐘 To start, I want to say that I’m appreciative that PgBouncer exists and the work its open source maintainers put into it. I also love working with PostgreSQL, and I’m thankful for the incredible amount …

Making Tanstack Table 1000x faster with a 1 line change

A few months back I was working on a Javascript frontend for a large dataset using Tanstack Table. The relevant constraints were: Up to 50k rows of content Grouped by up to 3 columns Using react and virtualized rendering, showing 50k rows was performing well. But when the Tanstack Table grouping …

Is there an ideal coding style?

Nope! There isn’t. The coding style you use is a preference. Even if studies have backed your preference1, it does not matter. The next team you work on or codebase you inherit may not follow that preference. But if they have implemented a consistent style, use it. If you are open to using it, and …