Ruby can serve 27k req/sec. Why do I need a 48-core server for my 80 req/sec Rails app? Wew, real shitstorm after yesterday's tweet regarding Hetzner instance pricing. I fired off a quick tweet from my car without really thinking too hard or spelling out the whole context, next… x.com/i/web/status/1…
Woke up this morning to a notification that my PayPal account has been deactivated, so I can no longer sell my courses through PayPal. 😬 It must be some sort of mistake. Do I know anyone at PayPal who can escalate this internally? pic.twitter.com/JYLI3HM1xj
rails + jupyter notebooks + VS code = a happier dev 😊 I've replaced my local #rails console by Jupyter Notebooks in VS Code ⬇️
Did the smart people figure out how many Rails threads I should use on a run-of-the-mill 2x Heroku dyno yet? My small brain got lost about 5 posts into that thread :)
Did the smart people figure out how many Rails threads I should use on a run-of-the-mill 2x Heroku dyno yet? My small brain got lost about 5 posts into that thread :)
Performance tip: If your application is slow to boot, use bumbler (github.com/nevir/Bumbler) to easily find out why. I found an unnecessary HTTP call in the initializer, 4 similar debug gems, and a heavy unused gem and sped up the boot time of a large app by 2x🔥by removing them. pic.twitter.com/cvuQAMgYEj
Tired: « Ruby on Rails is sooo dying in 2023 » Hired: RoR is the most in-demand skill in 2023. Source: HIRED State of Software Engineering 2023 pic.twitter.com/fnWmcLSvh3
🧮 Ruby's Enumerable#tally is so underused It's great for quickly exploring your data without writing a bunch of loops and counters pic.twitter.com/141i9n8BXJ
💡Rails tip: logs can be tagged with contextual information (current_user_id, account_id, etc.) to make operations and debugging easier. 👉🏻Use the tagged method to apply tags to a block of code or ... 👉🏻don't pass a block and get a new (tagged) logger Next tweet: tag pattern pic.twitter.com/TEACf2YR5h
💡Rails tip: Rails has a TON of settings. Below are three settings that may come in handy in most projects: 1️⃣Raising an error when batch processing replaces ordering 2️⃣Warning when fetching too many rows 3️⃣Async destruction via a dedicated queue What should I discuss tomorrow? pic.twitter.com/tjgXgOpoYR
In Ruby, there's a misconception about Bang 💥 methods(map!, upcase!, gsub!, ...) that the ! exists because it mutates the variable. The Bang(!) in a method is a code convention to warn you that their behavior differs from their normal version (example: map! for map). 👀👇 pic.twitter.com/M3AIX94pOc
Method chaining in Ruby is an interesting idiom for building DSLs(Domain Specific Languages). I remember when I first saw code().like().this(), my first reaction was "Oh, this is cool!" and felt the need to learn how to do it. 🧐 Here's a short and simple explanation: 👇 pic.twitter.com/aDxoKmzvLS
Rails tip: you can easily track slow DB queries without any additional gems pic.twitter.com/xMfmsBF7nO
💡Rails tip: building queries with Active Record is easier when you treat it as a DSL on top of SQL. ⚠️Stop fighting the framework! Step zero: understand SQL Step one: understand how Active Record constructs map to SQL I'll cover the basics today, advanced stuff tomorrow. pic.twitter.com/vvPlw84ncO
Where does everyone usually put their POROs? I know a lot of Rails apps have a services folder (not my preference). I sometimes organize by design pattern. That gets kind of silly sometimes though. Is lib an appropriate place for POROs?
Rails provides a `Configurable` concern that lets you add configuration options on classes. It uses `OrderedOptions` behind the scenes, so you can use the method-like syntax. pic.twitter.com/3iWiPciWLl
🧵 (3/4) Finally, I just read the slides and am watching a talk by Cameron Dutro (@camertron) entitled “Advanced Arel: When ActiveRecord Just Isn't Enough”. The talk was given 8 years ago, but is still 100% relevant today. I cannot recommend it enough to anyone using Rails + SQL
⚡️ Database Tip Tag searching can be done wholly differently: You can store the tag primary keys in a JSON array and effectively search for overlapping tag ids or missing ones without very complex joins. A single where instead of multiple (slow) joins to do the same thing. pic.twitter.com/XrLACz33NE
Did you know that you can create a single-file Rails application? You shouldn't unless you are experimenting with something, but here is how it can be done: 🧵 👇
When I joined GitHub I remember thinking that I'd be learning fancy/unique Rails patterns needed for scale. Instead I learned "just use default rails". model/view/controller is good. twitter.com/taylorotwell/s…
@andrewmcodes I just have to re-post this from @sstephenson’s RailsConf talk. This is why Rails wins. pic.twitter.com/jKANexCbRj
Ruby on Rails is coming back! If you're on the Javascript train, you're probably tired of new releases. But this one's gonna rock the boat. Here's why... 👇🧵
No idea how to implement a new Ruby on Rails feature, model, controller, or migration? How to write a proper test? Here's a list of 216+ Rails Apps you can use as a reference, and how to easily find what you need.💣 hexdevs.com/posts/massive-…
With @rails 7, @railshotway (HoTW⚡️Re hotwire.dev), Stimulus, Strada, @bridgetownrb, @render and things like this - I believe @rubylangorg is about to have a renaissance. I can't imagine building Web2 applications in anything else right now. LFG. twitter.com/andrewculver/s…
Ruby object count rules of thumb: <10,000 = don't sweat it 10k->100,000k = might matter if you loop, but also don't worry about it 100k->1mil = reducing objects would speed this up considerably 1mil->10mil = This is increasing your process' memory + is v. slow >10mil = ☠️
Reusable Turbo-iOS Project Configured Entirely From Your Rails App including app colors, navbar buttons, tabbar tabs, triggering backend javascript, toggling functionality whether user is logged in. #rails #rubyonrails #turboios #iosdev dev.to/dalezak/reusab…
My grandma 👵🏻 has Alzheimer’s, she has trouble remembering what to do during the day. I’ve created an always-on iPad app using Turbo-iOS that shows her what’s on her schedule. Events are added using a simple shared Google calendar and pushed to the iPad using websockets. pic.twitter.com/wrRNlqcv5B
💎 Ruby tip💎 Did you know that ActiveSupport gives you a module that allows you to easily make any class or module configurable? And Rails controllers already have that included by default. ↓ Example ↓ #ruby #rails #rubyonrails pic.twitter.com/jalAyAAXba
🧮 Quickly explore your data with Ruby Enumerable methods `uniq` and `tally` boringrails.com/tips/explore-d… pic.twitter.com/tVAWQVwnmM