TIL speeding up Magit on MacOS #emacs
Caring for Bugs: In code for tech progress, in nature for harmony 🦋 | Founder @ RedGems.dev | Freelance Ruby Developer
TIL speeding up Magit on MacOS #emacs
If you're working with database extensions, it can be helpful to exclude tables added by your extensions from your schema file. Keep it free from clutter! 🧹
The example shows SQLite and Spatialite, should work with any database and extension though.
TIL that the Ruby interpreter won't load a file with a shebang line that doesn't contain "ruby"
This fails:
#!/bin/gem-language
#!some-wrapper-for-ruuuuby
But this is fine:
#!aaarubyeee
#!/random/nonexistent/directory/ruby
I use SVGs a lot - and so should you! They're great.
Here's how you easily inline them. No need for any additional gems. Twelve lines of helper method are all you need 👌
Fast Allocations in Ruby 3.5
https://railsatscale.com/2025-05-21-fast-allocations-in-ruby-3-5/
Discussions: https://discu.eu/q/https://railsatscale.com/2025-05-21-fast-allocations-in-ruby-3-5/
If you're creating a reasonably complex Thor CLI, you'll likely want to reuse common method options. Here's a simple way to do that.
TIL: You can pass modifies to generators using curly braces. For example, create a decimal column with precision and scale 🤩
I got to pull out a nice RSpec trick today - using compound expectations.
I wanted to check that a method was called with a (rather large) string that had a few different substrings in it.
expect(instance).to receive(:method).with(
a_string_including("thing 1") &
a_string_including(obj.message) &
a_string_including("asdfasdfgasd")
)
The trick here is combining matchers with &
There's other ways you might do this, but the test output is really nice this way.
TIL: graphql-ruby supports async data loaders out of the box. A must have if you have fields that do network requests when resolved.
Good progress writing a #ruby SDK for Datastar. This is a simple Rack app streaming UI updates to the browser from two different threads.
@joeldrapper I think I'm in this scenario (with some more overhead) because I have plain SLIM content that are aggregated before or after the view_template.
Thanks a lot for your explanations, I now gets why my helpers are being call in the before_template using vanish.
I'll keep digging, using your example as documentation \o/
I need to migrate an "old" framework based on #phlex . I'm working on adding the deferred rendering to our existing stack; and can't wrap my head around what that `vanish(&)` thing do.
So many unexpected behaviours, if only we had time to do this more thoughtfully at first.
Are you an engineer and want to make a difference?
1. Try out Hanami. https://hanamirb.org
2. Support Ruby Central https://rubycentral.org
3. Support Mastodon. It's the only billionaire-proof social media.
RuboCop 1.71 is out! Lots of small improvement in this release (see for all the details https://github.com/rubocop/rubocop/releases/tag/v1.71.0), but I'd like to highlight that supposedly now RuboCop handles properly safe navigation in every single cop!
It only took us 8 years to get there! 😅
A simple trick to understand Ruby’s lazy enumerator
https://joyofrails.com/articles/simple-trick-to-understand-ruby-lazy-enumerator
Beautiful visual demo of how lazy enumerators help avoid unnecessary work.
ActiveRecord Quiz
https://learnetto.com/activerecord-quiz
Discussions: https://discu.eu/q/https://learnetto.com/activerecord-quiz