Weeknotes 223
5th October, 2025
“Now there are graphs”
-
I had to reboot my Apple TV remote again, same issue as last time, the volume buttons stopped working. It had a good 832 days to be fair.
-
DataGrip Is Now Free for Non-Commercial Use – I remember liking DataGrip when I used a trial a few years ago. Might be worth a look.
-
A gem to measure production code usage, showing a counter for the number of times each line of code is executed. Coverband allows easy configuration to collect and report on production code usage. It reports in the background via a thread, can be used as Rack middleware, or can be manually configured to meet any need.
I always forget this tool exists, so noting it here to remember.
-
I found this article via the Primeagen video on the most recent npm supply chain attack. It’s a very interesting take on package managers that is at odds with my own views and I expect the views of most people I know. It has been thought provoking.
When I first started getting interested in Elixir I noticed that there was much more of “write it yourself” attitude to dependencies. Instead of authentication libraries, they supplied a generator that you could maintain yourself (this is different to scaffolding). Coming from Ruby, that was surprising.
Maybe we’ve gotten this wrong for a long time.
(Do you remember when we used to routinely package things such as CSS frameworks into gems? – madness.)
-
Why Auto Increment Is A Terrible Idea
Use UUIDs as primary keys. They can be freely exposed without disclosing sensitive information, they are not predictable and they are performant.
Also, UUIDs being random, you lose locality, and your index ends up scattered. This causes a definite performance hit when confronted to high insert rates. Also, this creates extra disk use.
-
Speaking of which, UUIDv7 Comes to PostgreSQL 18 – version 7 UUIDs seem like a big improvement for performance as they are now more sortable to help index performance.
However, if I’m reading this correctly you now lose one of the previous benefits as UUIDv7 will expose when the UUID was created as it now contains a timestamp component. May or may not be a problem for you?
-
I wanted to try out the Postgres 18 UUIDv7 support. I got build failures at first until I did this:
$ brew info icu4c $ env PKG_CONFIG_PATH="$(brew --prefix)/opt/icu4c/lib/pkgconfig" asdf install postgres 18.0 -
If you’ve used Rails you will no doubt have had issues with inconsistent database state when switching branches.
actual_db_schema sounds like it can help.
Wipe out inconsistent DB and schema.rb when switching branches. To do that, install this gem and use the standard rake db:migrate command.
-
I set up a Raycast extension to control my monitor backlight (Hue Play Gradient Lightstrip for PC). It’s not exactly what I’d like as it still requires too many steps, but it’s a start.
-
Sometimes the thing your are adding is so trivial, you might as well just implement it yourself. The left_pad fiasco of 2016 is a great example. It was literally a dozen or so lines of code that left-padded a string, and yet thousands of projects decided to add it as a dependency rather than write it themselves.
The reasons are many.
-
I am in no way “good” at Lua, but the main issue I’ve always faced with it was not the language but the context of hacking on it in Neovim. Lua modules are cached when run so changes would not be reflected as I edited source files. The only way it seemed to work was to restart
nvimeach time I made a change which I’m sure you can appreciate really slows down progress.I’ve looked into this “problem” before but could never settle on an answer. My old mate Claude stepped in and suggested several options, and I went with this plenary-based (originally written by TJ DeVries) solution.
I added a temporary keybinding like this.
vim.keymap.set("n", "<F5>", function() require('plenary.reload').reload_module("notes") require("notes").notes() end, { desc = "Reload and test" })Now I can hit
F5and the modules are reloaded and the code run.My module setup looks like this:
. ├── lua │ └── notes │ ├── init.lua │ └── picker.luaAnd all modules under
notes/seem to be properly reloaded, which is exactly what I wanted. -
If you have some Lua table you want to inspect, you can do this:
vim.notify(vim.inspect(picker))But if your table is big it will be unwieldy and difficult to read. Instead you can write the result to a register…
vim.fn.setreg("+", vim.inspect(picker))…and it becomes available on your clipboard for pasting somewhere else.
-
HDR gradients – a tool to create CSS HDR gradients.
-
I noticed somewhere that Passenger 6.1.0 was released recently and I realised I had completely lost track of Passenger. I’ve not used it in years but I remember the early days where it saved us from having to restart our app servers every hour 😆 Apparently it now supports a variety of languages, not just Ruby.
-
Hidden Touch ID for Apple Magic Trackpad – very nice idea. I love Touch ID, but I don’t love having to reach for my laptop when I’m at home and it’s elevated up on an arm. I’ve heard people mentioning the “tape a Magic Keyboard” under the desk trick, but I’m not sure I can cope with that!
-
Better late, than never.
-
Incidentally, I asked Claude for suggestions on where I could generate a sparkline graph and export it as an SVG to include here. Instead of suggesting links it just built one for me then and there that I could interactively enter my values into! 😮
-
On Sunday we headed up to Newcastle to see the Beans. It was great fun, and the seats were absolutely fine considering the theatre seat map made them look a lot further away than they were.
-
Edinburgh-bound next week. Since I live closer now, it is somewhat more accessible than it once was, so I decided I could handle the train journey to attend the Scottish Ruby meetup.