Recently, April 20, 2025
Angelina caught a cold, so the past week has been largely laying low and sleeping 9+ hours a night trying not to catch it myself. Not the worst life.
Elevating this to top fish recipe: Rockfish, Garlic, Shallots, Tomatoes & and a lotta Herbs.
Using ChatGPT’s Web Search is ok. “Find me articles, marketing posts, and conference talks about [something]”. I have to follow up several times slightly differently (“anything else? What about lightning talks?”) and copy resulting links into a separate doc to organize to have something approaching comprehensive…. But pretty good and better than what I can get out of either Kagi or Google. I ignore the summaries and chatty nonsense and just copy the links and read them myself. Sorry climate and future generations.
I cut ~30 seconds from my GitHub Actions build times by replacing my apt-get install
step with an action that caches using awalsh128/cache-apg-pkgs-action; there’s a couple options but this one had the most stars in the marketplace:
# Before
- name: "Install packages"
run: |
sudo apt-get -yqq update
sudo apt-get -yqq install libvips-dev
# After
- name: "Install packages"
uses: awalsh128/cache-apt-pkgs-action@7ca5f46d061ad9aa95863cd9b214dd48edef361d
with:
packages: libvips-dev
version: 1 # cache version, change to manually invalidate cache
Turbo/hotwire stuff: I’ve been gradually replacing more granular broadcasts of like prepend/update/remove with page refresh events for their simplicity. The challenge I have is that if there is a form + refreshable content on the same page (sometimes with the form in the middle or multiple forms). If the content refreshes, I don’t want to refresh the form. But I do want the form to refresh itself when submitted (show validation messages, reset, etc.). I can wrap the form in a data-turbo-permanent for the first part, but then the form doesn’t update when it’s submitted.
My workaround to that is a stimulus controller that wraps the form and removes the data-turbo-permanent
when the form is submitted, inspired by this. Is there a better way to do it?
import { Controller } from "@hotwired/stimulus"
// To be used to wrap a form to allow the form to be permanent during
// Turbo Stream refresh events but to update normally when submitting the form.
// Example:
// <div data-turbo-permanent id="<%= dom_id(@phone, :message_form) %>" data-controller="permanent-form">
// <%= form_with ...
// </div>
export default class extends Controller {
connect() {
this.submitHandler = this.submitForm.bind(this);
this.element.addEventListener("submit", this.submitHandler);
}
disconnect() {
this.element.removeEventListener("submit", this.submitHandler);
}
submitForm(event) {
if (event.target.matches("form")) {
this.element.removeAttribute("data-turbo-permanent");
}
}
}
I finished Spinning Silver. Now reading The Space Between Worlds.
I bought Javascript for Rails Developers, largely because I like the posts on Rails Designer.
I started the demo for Unbeatable (“where music is illegal and you do crimes”); I like the art style, but is it fun? I dunno.
I had to go to the shipping warehouse to pick up my new mechanical keyboard because I kept missing the delivery person, but it otherwise arrived no problem.