mudge

@mudge@ruby.social
196 Followers
68 Following
796 Posts
Computer programmer up t’north. Former organiser of London Computation Club and speaker at London Ruby User Group, now mostly writing Ruby, Go and JavaScript but also Python, PHP, Rust and Clojure. My views do not represent those of my employer.
webhttps://mudge.name
githubhttps://github.com/mudge
sponsorhttps://github.com/sponsors/mudge
If you’re using Rails’ `send_stream` https://api.rubyonrails.org/classes/ActionController/Live.html#method-i-send_stream, don’t forget to set an ETag or Last-Modified header (perhaps with `fresh_when` https://api.rubyonrails.org/classes/ActionController/ConditionalGet.html#method-i-fresh_when or `stale?` https://api.rubyonrails.org/classes/ActionController/ConditionalGet.html#method-i-stale-3F), otherwise the `Rack::Etag` https://github.com/rack/rack/blob/45d2f874530e55b2ac77092da63b00ee979d18ba/lib/rack/etag.rb#L6 middleware will block your response from streaming as it will try to digest the entire body to set its own ETag.
ActionController::Live

Action Controller Live Mix this module into your controller, and all actions in that controller will be able to stream data to the client as it’s written.

Treat day.

If you're on Heroku and haven't yet upgraded to Router 2.0, they will begin migrating Standard and Performance tier apps in two weeks' time on 16 July (we found all our smaller, staging apps had already been migrated).

If you're using Puma, take note of https://www.heroku.com/blog/pumas-routers-keepalives-ohmy/ and set `enable_keep_alives false` in your `config/puma.rb` (see https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#keepalive).

Pumas, Routers & Keepalives—Oh my!

Heroku Router 2.0 launches with HTTP/2, better performance, and reliability. Learn how we uncovered a Puma bug during beta and how to avoid it.

Heroku
Well, my 1Password account renewed for another year and I’m now stuck with hundreds of passwords (some shared, some not) in both Passwords and 1Password. The reality is that UK institutions don’t really fit the Passwords app assumption of a single username and password and I rely on 1Password’s CLI for things like generating OTP codes when publishing gems.

re2 2.16.0 is now out, upgrading the bundled RE2 to 2025-06-26b, Abseil to 20250127.1, and adding a new `RE2::Set#size` method for returning the number of patterns in a set.

https://github.com/mudge/re2/releases/tag/v2.16.0

Release 2.16.0: RE2 2025-06-26b and Abseil 20250127.1 · mudge/re2

Changed Upgrade the bundled version of RE2 to 2025-06-26b. Upgrade the bundled version of Abseil to 20250127.1. Added Added RE2::Set#size to return the number of patterns in a set. SHA256 chec...

GitHub

Has anyone else been having issues installing packages on GitHub’s Windows runners with ruby/setup-ruby-pkgs recently due to dependency conflicts with GCC 15? Maybe @flavorjones?

Look at this tale of woe: https://github.com/mudge/re2/actions

Workflow runs · mudge/re2

Ruby bindings to RE2, a "fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python". - Workflow runs · mudge/re2

GitHub

Go 1.25 is coming soon, and the official release notes are pretty dry.

So I prepared an interactive version with lots of examples.

https://antonz.org/go-1-25

Go 1.25 interactive tour

Fake clock, new GC, flight recorder and more.

If you find yourself wanting to test a TCP service (e.g. that you can connect to memcached, Redis, or PostgreSQL), don’t have telnet installed but do have curl to hand: you can use curl as a telnet client with `curl telnet://localhost:11211`.

See https://everything.curl.dev/usingcurl/telnet.html

TELNET - everything curl

everything there is to know about curl, libcurl and the cURL project

Note that Sidekiq only recommends using Redis' `noeviction` policy for its keys so this is for *cache-only* Redis instances: https://github.com/sidekiq/sidekiq/wiki/Using-Redis#memory

Heroku Key-Value Store (formerly Heroku Redis) has a default `maxmemory` policy of `noeviction` meaning it'll return errors if you reach the memory limit. To follow the Rails Guides recommendation for cache-only Redis servers (see https://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-rediscachestore), set the policy to `allkeys-lfu` instead:

```
$ heroku redis:maxmemory NAME --policy allkeys-lfu
```

Caching with Rails: An Overview — Ruby on Rails Guides

Caching with Rails: An OverviewThis guide is an introduction to speeding up your Rails application with caching.After reading this guide, you will know: What caching is. The types of caching strategies. How to manage the caching dependencies. Solid Cache - a database-backed Active Support cache store. Other cache stores. Cache keys. Conditional GET support.

Ruby on Rails Guides