My favorite way to use rate_limit! 🤩
Pair it with a handle_rate_limit method and a dedicated BusyController to centralize how your app responds to throttled requests.
That’s how Rails turns a messy problem into a simple solution. 💚
#rubyonrails
I love this lesser-known technique for checking if two arrays contain the same elements, regardless of order. 🤩
⚠️: `to_set` is cool but may slow down huge datasets! 😉
#rubyonrails
The Builder-to-Proc pattern is among my top 3 favorites! 💚
By defining `to_proc` on `self`, you can pass a class directly to `map`, and Ruby converts it into a builder for each element! 🤩
#rubyonrails
Did you know about `up_only` in ActiveRecord::Migration?
It lets you run code only when migrating up. 🤩
A simple but powerful method that deserves more attention.
#rubyonrails
Rails 8 introduced `rate_limit` for controllers.
You can combine it with a `handle_rate_limit` method and a `BusyController` to centralize how you respond to throttled requests.
And that's how Rails turns a messy problem into a simple solution. 💚
#rubyonrails
My day is a bit messy, and I tried something straightforward:
I don't think about the expected outcome. I only fulfill mandatory daily tasks:
→ 500 push-ups
→ 7 hours of sleep
→ 4h of coding
→ 4h of content creation and marketing
Let's see where it brings me in 365 days!
Watching football is like watching p*rn:
- You get addicted
- Your mood depends on your team’s result
- You waste hours
I stopped 3 years ago. Now I build and watch things that actually move me forward.
Total brain rot otherwise. #buildinpublic#PsgInter
Did you know the `in?` predicate isn't limited to arrays?
It checks whether an object is included in another object! 🤩
The parameter must respond to `include?`.
If you need to display verbatim HTML in your views, you can replace `<%= raw ... %>` with `<%== ... %>`.
It’s easier to read and works the same way! 🤩
#rubyonrails #erb