Quick reminder that you should be using Jemalloc 馃憖 #rubyonrails #ruby
Ruby + Rails : Archive
by @skillstopractice.com
Archival feed for Ruby + Rails : Distilled Had to split this out because Skyfeed is pretty glitchy about long term storage. May eventually no longer need this.
TIL about the ActiveSupport `mattr_accessor` method. It defines both class and instance accessors for class attributes. Handy little shortcut! 馃敡 #ruby #rubyonrails
Consider using pattern matching in Ruby. I wanted to update a user's location (RGeo Point) from an endpoint which receives a JSON object: { lat: ..., lng: ... }. Using pattern matching, we can detect such an object's shape, falling back to a catch-all (_) with an if statement for regular Points.
TinyBits is getting a new interesting feature, you can now (using the repo's head) supply the pack/unpack method with an external dictionary. For shorter messages with no duplicate strings this can lead to a dramatic size reduction, from 96 to 34 bytes in the example below
I want to prefix a string only if it's not already prefixed. Somehow this feels...wrong. Does anyone know a more refined solution? 馃 #ruby
TIL: graphql-ruby supports async data loaders out of the box. A must have if you have fields that do network requests when resolved. #rubyonrails #graphql graphql-ruby.org/dataloader/a...
Suppose you have a small script that grabs news headlines over RSS and convert them to a simple Markdown list of links. It's been working fine, then one day when you run it, you get a Socket::ResolutionError with the message "getaddrinfo(3): nodename nor servname provided, or not known" (1 of 2)
It doesn't take much to make Arel more ergonomic.
This seemingly pointless change made a very significant performance difference. Can you guess why? The answer is in the PR: github.com/okuramasafum...
Free sample of my "Bug Hunt : Volume 1" guidebook is now live. Check it out here: bh-1.skillstopractice.com (10 of 56 exercises included) Please preorder if you expect the full guide will be useful to you after trying the sample. Much more to say on all this, but for now, happy hunting!
Some folks asked me how I use AI to help with debugging. Here's a good example. I asked it to write a script that will find a combination of specs where a flaky test fails. It took maybe 1 minute 12 seconds from writing the prompt to getting the result in my terminal.