Sean

Weekly Brain Dump #35

- 590 words

At a Glance

Ruby on the Frontend

This experiment is still going on. Now that I’m leaning into setting up testing I’m definitely feeling the pain of the Ruby/JavaScript barrier. Particularly with promises or trying to delay a test check until a redraw.

I wrote this beautiful bit of hackery to let me wait for a check to be true before executing a block of Ruby code.

window.wait_for = (block) => {
  return new Promise((resolve) => {
    if (block()) {
      resolve();
    } else {
      setTimeout(() => {
        window.wait_for(block).then(() => {
          resolve();
        });
      }, 10);
    }
  });
};

This has allowed me to write a test that waits for data to load after a promise is resolved like such.

QUnit.module "Notes" do
  context "Index" do
    test "has Controls shown by default" do
      mount :Notes_Index

      assert_equal(
        "Controls",
        Fragment::Notes::Index.panel.tabs.active,
        "starts with controls active"
      )

      wait_for do
        Fragment::Notes::Form.active == "Controls"
      end.then do
        assert_equal(
          "Controls",
          Fragment::Notes::Form.active,
          "Controls are active"
        )
      end
    end
  end
end

My current battle is getting stubbing or mocking to work correctly. I’m not sure I’ll get it working well and am super close to just switching to Rspec/Capybara and skipping testing in the browser. I want to fight it out though as I feel unit testing is pretty useful here and helps me write cleaner code.

New Handheld Console

I ordered myself an Anbernic RG CubeXX as a reward for getting through this tough couple of months. I’m very excited by this as I love my RG35XX but was disappointed at how impossible it was to port Taylor to it due to locked down hardware. I have the original so it’s not based on the H700 chipset so it doesn’t have WiFi or accessible GPU acceleration.

I am keen to try and port Taylor to it so I can build games to run on the RG CubeXX. Something about that just gets me excited and want to develop games again. I’m also tempted to try and get a basic desktop Linux running on it as I think that would be quite funny.

How to Make a Nintendo 64 Game in 2026: I had no idea Nintendo64 homebrew had come so far.

Shrinking Ruby Hashes: Nothing quite like a deep dive on a niche Ruby topic.

Modeling State Transitions in Postgres: Diving into how to efficiently keep a status in a different table.

Archive of interesting links


Comments