Ross Kaffenberger

@rossta.net

Father of 2 boys. Ruby on Rails and JavaScript developer. Triathlon on the side. Hacking on http://joyofrails.com

I’m available for hire. I’m an experienced Ruby, TypeScript and CSS engineer looking for a new full-time position. I can help you with performance, concurrency, testing, architecture and API design problems on tooling or product teams. I’d really appreciate any personal introductions. DMs open. 🙏

One thing I loved about DarkSky is to get an idea of what the weather is usually like in some location at a given time of year. What’s a good app for that these days?

2024 ended up a pretty solid writing year for me. Here are the top 10 posts by views. Of them, 8 were written in 2024 (tanstack and pgbouncer have had alot of staying power, they're from 2023). I'll link to each after this, in case you'd like to check them out!

Bild

The new Ruby docs are looking great. The search feature is fast. New experimental features appear to be in the works too, like type signatures and runnable code examples. Awesome stuff!

Ruby Enumerator docs screenshot

Made some nice improvements to the Lighthouse score for the Joy of Rails homepage today. Biggest different was optimizing the article illustrations.

Lighthouse score for Joy of Rails homepage BEFORE improvements: 

Performance: 79
Accessibility: 82
Best Practices: 96
SEO: 83Lighthouse score for Joy of Rails homepage AFTER improvements: 

Performance: 100
Accessibility: 88
Best Practices: 96
SEO: 100

I love Ruby so much that I write my HTML in Ruby. I’ve got nothing against ERb, but after a year of writing Phlex components, I’m not looking back.

Example Phlex component in Ruby code:

render CodeBlock::Body.new(data: {controller: "snippet-editor"}) do
  div(class: "grid-stack") do
    render CodeBlock::Code.new(source, language: language, data: {snippet_editor_target: "source"})
      label(class: "sr-only", for: "snippet[source]") { "Source" }
      div(class: "code-editor autogrow-wrapper") do
        textarea(
          name: "snippet[source]",
          data: {snippet_editor_target: "textarea"}
         ) { source }
      end
    end
  end
end

It’s such a simple thing, but I love that Ruby treats the backslash character as a line continuation, similar to a shell. I often use it to omit parens and group keyword arguments on new line.

Ruby code:

def self.from(sitepress_resource)
  Resource.new \
    request_path: sitepress_resource.request_path,
    body: sitepress_resource.body,
    title: sitepress_resource.data.title,
    description: sitepress_resource.data.description,
    image: sitepress_resource.data.image,
    # ...

I was hoping someone would show how Ruby can do better than bddicken/languages indicates with optimizations like YJIT. @jpcamara.com delivers with this deep dive into Ruby nested loop performance complete with JS visualizations, exploration of machine code, and proof that Ruby can be faster than C.

JP Camara@jpcamara.com · 2y ago

I dug into CRuby and YJIT to better understand a recent, popular synthetic benchmark run against various languages. It was alot of fun to investigate how YJIT and CRuby work together! jpcamara.com/2024/12/01/s... @k0kubun.com @timtilberg.bsky.social