Posts tagged ruby
reduce, each_with_object, performance and you
I was debugging an oddly slow bit of code today at work. The code in question was fine for smaller collections but egregiously slow as soon as the collection...
Advent of Code '24 — Day 1
We're back again with Advent of Code — one of my favourite times of year. Partly for the puzzles, and partly because it's a sign the year is winding up...
RSpec bisect saves the day!
Over the last few days, our test suite at work had a pretty gnarly run of test failures. We run almost all of our Ruby tests through RSpec, and group...
TIL: Testing actions in Hanami 2
I was pairing with a colleague this afternoon at work on trying to test an action in Hanami 2 where we explicitly needed to read the body of the request...
Advent of Code 2023 — Day 9
More camels and oasis-es, less cards. In this puzzle, we're using our trusty Oasis And Sand Instability Sensor — OASIS — to analyse our surroundings....
Advent of Code 2023 — Day 8
Another fun one! Today's puzzle had us navigating a sandstorm. Our map, a set of directions, through what looked like a graph. Starting at AAA, we want...
Advent of Code 2023 — Day 7
Day 7 saw us playing cards, on camels — camel cards! Camel cards are like poker. But simpler, so you can play it while on a camel. The hand-rules are...
Advent of Code 2023 — Day 6
Catchup time! 😅 Time for day 6 — on day 11. Today's puzzle has us racing boats. But not any boats, toy boats that are wound up with the hold of a button...
Advent of Code 2023 — Day 5
Please, my CPU, it needs help! A classic entry for AoC, in which there is a brute-force option that will melt any CPU. Today's puzzle was fun! But also...
Advent of Code 2023 — Day 4
My favourite so far! Inspired by some folks at work, I decided to try and do this as functionally as possible. Apparently there are some similarities...
Advent of Code — Day 3
And so the painful puzzles begin! Today's puzzle revolved around an ascii schematic and we were tasked with parsing it and finding adjacent elements in...
Authenticated routes with Hanami 2
As I was building out the admin area of this blog, I wanted to make sure only authenticated people could hop in an edit things. The first iteration of...
Advent of Code — Day 2
Onwards! To day 2. (at least until the rest of the end-of-year things start getting in the way — which normally happens at around day 6) Started reading...
Advent of Code — Day 1
Advent of Code is one of my favourite times of year. Partly for the puzzles, and partly because it's a sign the year is winding up. Like 24 ways to impress...
How I debug with Ruby
Over the many years that I have been working with Ruby, I have never really learned to use a debugger, and really only lean on tools like Pry to start...
How I use Obsidian
I've been using Obsidian for a little while now. At first, it was largely just a replacement for Notes.app, like Ulysses before it, I preferred it purely...
Ruby learning materials.
I often get asked about recommendations for resources to learn Ruby (and how to program, generally). This list is intended to catalogue the various resources...
Deploying a Hanami 2.0 app to fly.io.
I have a couple of small hobby apps that were on Heroku's free tier (RIP) that I have now moved over to Fly.io. Fly.io has a migrate from Heroku process...
Managing dotfiles.
It's not often that I get a new computer, but on the odd occasion that I do, I like to have all of my config prepared and ready to copy over! To achieve...