iOS 26 variable web font weight issues

iOS 26 is able to display web fonts in Lockdown mode, with certain limitations. One of these seems to be an issue with web fonts, with variable font weight, which is the default when grabbing an embed code from Google Fonts:

Default Google Fonts embed configuration for variable weight fonts.

This works perfectly on the desktop, for all major browsers I’ve tested (Chrome, Safari, Firefox). However I’ve run into an issue, with Nunito font specifically, on the recently released iOS 26, where it would render everything in a single, light font weight, like so:

All font-weight from headings and strong tags is missing.

This is in Lockdown Mode and the embed code looks like this:

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap" rel="stylesheet">

I experimented a lot with various font- CSS properties, but nothing helped. Then I tried the single font weight embed, instead of variable and got it working ๐Ÿฅณ

Embed configured for single font weight.

The trick is to grab all the embed codes, for all the weights you use on your site and combine them, like so:

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;1,200&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital@0;1&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,800;1,800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,900;1,900&display=swap" rel="stylesheet">

Now iOS 26, in Lockdown Mode, renders the custom web font and all the font weights properly:

tinyups3 – streaming S3 uploader

Working with the official AWS S3 CLI, as well tools like s5cmd I quickly realized they aren’t optimized for resource constrained systems, rather more towards uploading as fast as possible and in parallel. This is great for most use cases, but not when you want to minimize the impact on the system, like during frequent backup operations and on a system with half a gig of memory for example.

I dusted off my Go tools and build a simple tool to serve this purpose. Say hello to tinyups3 – streaming S3 uploader optimized for minimum CPU and RAM usage. It’s a single binary, open sourced under the MIT license.

Head over to GitHub for installation and usage instructions.

Happy uploading!

testerobly – lightweight automatic test runner

I’ve been running into issues, like intermittent crashes, with guard, which is a favorite amongst Rubyists, when it comes to automatically running unit tests on a file change. I’ve decided it would be a fun exercise to create my own tool, addressing my needs specifically:

  • Listen for file changes and run matching tests.
  • Customize configuration per project.
  • Pause during git operations like checkout.
  • Run all tests with Enter press.
  • Fast, simple, stable and resource efficient.
  • Can be used together with interactive debug mode.

I’ve achieved that goal with testerobly which I published as a Ruby gem, under the MIT license.

I’ve been using it for many months now, on quite a few projects and it has been delightful. It does exactly what it says it does and gets out of the way.

Go check it out.

Recent open source contributions in the Turbo ecosystem

I’ve been pushing Turbo hard the past couple of months. That resulted in running into some edge case scenarios, which have not yet been resolved in the library.

One is an annoying race condition, related to incoming turbo refreshes stealing the navigation to another page. At the time of writing still waiting for merge. (Update: itโ€™s merged now ๐Ÿฅณ)

The other one, just merged to main, is an improvement to turbo-rails documentation, which came out of the above work too.

Configuring SSHKit in Automated Tests

When using Ruby’s SSHKit gem in your application, you might want to test code that uses it. Most likely, you don’t want to connect to real servers when automated tests are run. Luckily SSHKit includes a backend just for that, called Printer.

You can easily configure your test suite to use it:

SSHKit.configure do |kit|
  kit.backend = SSHKit::Backend::Printer
end

In a Rails application for example, simply add this to your test_helper.rb. Now all the execute statements will be printer to the standard output.

You can also implement your own SSHKit backend, based on the Printer class, if you need something more involved, like saving all the commands into a Thread.current variable and running assertions on them within your test.

MacOS Ventura firewall repeatedly asks to accept incoming connections when reinstalling a Ruby version with rbenv

On my Intel iMac on macOS Ventura 13.4 I ran into this annoying issue when reinstalling the same version of Ruby (3.2.2 for example) with rbenv. When running rails test:system the firewall’s “Accept incoming connections” dialog would pop every time, no matter whether you Denied or Allowed the connection to go through previously, making testing quite painful.

I couldn’t find a working solution through googling, but ChatGPT was able to help. It’s as simple as:

sudo codesign --force --sign - $HOME/.rbenv/versions/3.2.2/bin/ruby

Simply find the ruby bin version you’re having problems with inside your .rbenv folder and instruct macOS to re-sign it. The expected output should be something like:

/Users/klevo/.rbenv/versions/3.2.2/bin/ruby: replacing existing signature

After that, you’ll need to confirm or deny the “Accept incoming connections” Firewall dialog when running something like system test suite, but afterwards the Firewall should remember your choice.

Lastly, this only seems to affect Intel Macs. At least for me, no such issue occurred when reinstalling ruby with rbenv on an ARM MacBook.

Thanks AI ๐Ÿ™‚

navigator.clipboard does not work under plain HTTP in latest Safari (on .test domains)

I just noticed that on the latest MacOS Ventura 13.3.1 with Safari 16.4, the navigator.clipboard API is not accessible under plain HTTP .test domains, used with puma-dev for example. It returns “property is undefined” type of error.

The solution is to switch to HTTPS. With puma-dev this is simple, as it comes out of box with support for secure connections.

I haven’t had a chance to test it with plain old localhost yet, but I figured to post this, in case it trips you too.

Solution: Some Mac OS Mail Favourites are grayed out and cannot be deleted

I encountered the issue of a grayed out folder that can’t be deleted, in MacOS Mail app today. The discussion on Apple’s forums does not provide any actionable answers. After a while I figured out a solution myself and it’s very simple:

  1. Create a new mailbox (Mailbox -> New Mailbox…). For Location, choose “On My Mac” and name it the same as the grayed out folder in Favourites that you’re struggling with.
  2. Once you add this new mailbox, the one in Favourites should become accessible again. You can now right click on it and hit “Remove from Favourites”.
  3. You can now also delete the empty local (On My Mac) mailbox folder that you created in step 1.

Hope that helps.

How I run puma-dev alongside Rails’ bin/dev

The bin/dev script Ruby on Rails ships with, if you for example init the app with --css=tailwind or --css=bootstrap is great. It comes with auto-generated Procfile that will launch the web server and the Tailwind CSS (or other) preprocessors. In addition bin/dev will install the foreman gem if it does not exist on your system.

At some point however, you’ll want to run multiple Rails applications on your developer machine. Doing that with localhost:3000 will get annoying at some point (cookie sharing, changing ports, everyone in the team handling it differently, no HTTPS to test with…).

puma-dev has been around for a long time to solve this. However while it takes care of running the web server part for you (in the background), you still want to see the logs, run your CSS (or JS) preprocessor or compiler, job workers, etc. I figured out it’s simply about adjusting the Procfile and bin/dev slightly and one can use the familiar approach in conjunction with all the puma-dev features.

This is what I do:

My Procfile.dev looks like this:

web: tail -f log/development.log
css: bin/rails tailwindcss:watch

The change is in the web: stanza. Instead of launching puma server, we simply tail the logs, as puma will be run by puma-dev in the background for you, as soon as you visit your local .test domain.

My bin/dev looks like this:

#!/usr/bin/env bash

if ! command -v foreman &> /dev/null
then
  echo "Installing foreman..."
  gem install foreman
fi

if ! command -v puma-dev &> /dev/null
then
  echo "Installing puma-dev..."
  brew install puma/puma/puma-dev
  echo ""
  echo "To finish puma-dev setup run:"
  echo "sudo puma-dev -setup"
  echo "puma-dev -install"
  echo "puma-dev link -n myapp ."
  echo ""
fi

foreman start -f Procfile.dev

I’ve added a section that installs puma-dev (if your team is using Homebrew) and prints out instructions on how to complete the setup.

For your use case, simple replace “myapp” above with the name of your app.

This feels like sticking to the Rails way and is easily extensible if you also want to launch other services in development, like job workers, by simply adding a stanza in the Procfile.dev. Neat.