Short Ruby Newsletter

Share this post

πŸ‘‹ Short Ruby News - edition #23

newsletter.shortruby.com

Discover more from Short Ruby Newsletter

A Monday summary of the articles, discussions, and news from the Ruby community
Over 3,000 subscribers
Continue reading
Sign in

πŸ‘‹ Short Ruby News - edition #23

Briefly about everything in Ruby world

Lucian Ghinda
Dec 19, 2022
6
Share this post

πŸ‘‹ Short Ruby News - edition #23

newsletter.shortruby.com
Share

This edition was created with the help of Adrian Marin from Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and Jakob Cosoroabă.

You can jump directly to one of the following sections if you like:

πŸ‘ Our Community

πŸ‘‰ All about Code and Ruby

🧰 Gems, Libraries, and Updates

🀝 Related (but not Ruby-specific)

More content: πŸŽ₯ 🎧 πŸ—ž (articles, podcasts, videos, slides, and newsletters)


πŸ‘ Our Community

πŸ‘ Yukihiro MatzΒ sharedΒ a link to the YJIT Benchmarks website:

Source:Β @yukihiro_matz

πŸ‘ Mark Mayo announced they are willing to support a Rails dev to implement some auth improvements for Mastodon:

Source: @mmayo@hachyderm.io

πŸ‘ Le Wagon MontrΓ©alΒ shared an online free event they are organizing aboutΒ Landing your first rails job - with Joe Masilotti

Source:Β @LeWagonMontreal

πŸ‘ AyushΒ launched the full bookΒ The Rails and Hotwire Codex

Source:Β @ayushn21

πŸ‘‰Ruby For AllΒ asked the community some questions and it would be great if we can help them and answer them:

Source: @rubyforall

πŸ‘ Joe MasilottiΒ launched a new Turbo Native workshop

Source:Β @joemasilotti

πŸ‘ Ruby ConfΒ sharedΒ a new Home Edition | RubyConf 2022:

Source:Β @rubyconf

πŸ‘ Rails Girls The NetherlandsΒ announced they are organising a new edition ofΒ Rails Girls NL

Source:Β @RailsGirls_NL

πŸ‘ Dave Kimura announced a forum section for Drifting Ruby:

Source: @kobaltz@rails.social

πŸ‘ Brandon Weaver announced voting on rubylearning.dev to choose the next course:

Source: @baweaver@ruby.social

πŸ‘ Brett Chalupa announced their free book about Building Games with Dragon Ruby

Source: @brettmakesgames@mastodon.gamedev.place

πŸ‘‰ All about Code and Ruby

πŸ‘‰ Nate HopkinsΒ sharedΒ a Replit to play with toggle reflex behavior Replit

Here's a simple replit demo where you can try out the `toggle` Reflex Behavior and its devtool. Let me know if it's working for you and what your first impressions are.
Source:Β @hopsoft

πŸ‘‰ Emmanuel HayfordΒ shared a Rails 7.1 tip for keeping log files from taking over disk space:

Rails logs files are unchecked: they can grow to whatever size imaginable. Not anymore, there's a new config option in Rails to keep log files from taking over disk space!
Source:Β @siaw23

πŸ‘‰ Stan Lo shared the difference between REPL and a debugger:

Source: @st0012@ruby.social

πŸ‘‰ Greg NavisΒ shared a code sample showing how to build URI in Ruby:

If you want to change the protocol, you need to use a different class. For example, to change to HTTPS use URI::HTTPS. It's NOT only a matter of the scheme in the URI (the part before ://), but also default port numbers.
Source:Β @gregnavis

πŸ‘‰ Kirill ShevchenkoΒ shared a code sample showing how to use Rails explain to debug slow queries:

The first thing that comes to mind when we talk about debugging slow SQL is EXPLAIN query. It's a great way to get a detailed breakdown of a database query. ActiveRecord provides an explain method that you can simply add to the end of your query to debug it.
Source:Β @kirill_shevch

πŸ‘‰ Scott Watermasyk shared why Phlex.fun could be a good choice:

Source: @Scottw@ruby.social

πŸ‘‰ Emmanuel HayfordΒ shared a Rails command to show unused routes (coming in Rails 7.1):

Source:Β @siaw23

πŸ‘‰ Postmodern started a good discussion about where we can use Ruby for rapid prototyping:

Source: @postmodern@ruby.social

There is a good discussion about how to distribute Ruby as a step for use in other areas (like CLI apps, for example).

πŸ‘‰ Greg NavisΒ shared an example of using whitespace and comments inside the Regexp:

⚠️ Don't use that regexp to validate emails. It's only a contrived example. Compare the before and after for the regexp: it's longer, but also easier to parse (for humans) and there are comments explaining the intent behind it It gets even better on more complex regexps!
Source:Β @gregnavis

πŸ‘‰ Shugo MaedaΒ sharedΒ a Ruby PR that will Disallow mixed usage of ... and */**

It seems like the proposed change will be:

Source: https://bugs.ruby-lang.org/issues/19134#note-9

You can read the discussion about this feature in the Ruby issue tracker

πŸ‘‰JoΓ«l QuennevilleΒ shared a nice piece of code showing the readability of case instead of nested ifs:

Source:Β @joelquen

πŸ‘‰ Greg NavisΒ shared aRails tip to use invert_where

Source:Β @gregnavis

πŸ‘‰Kirill ShevchenkoΒ shared a code sample showing how to use TracePoint to track the code call stack:

Source:Β @kirill_shevch

πŸ‘‰Greg NavisΒ shared a thread exploring various query performance in Rails:

Source:Β @gregnavis

πŸ‘‰ Andrew Atkinson asked about what PostgreSQL topics are missing:

Source: @andatki

There are a lot of good replies. Andrew summarized them in an article on their blog:

Source: https://andyatkinson.com/blog/2022/12/12/postgres-rails-guides-content

πŸ‘‰Jeremy SmithΒ shared a piece of code about how to remove Active Storage attachments:

Source:Β @jeremysmithco


If you have read so far and you like the content, maybe you take into consideration sharing this and subscribing:


🧰 Gems, Libraries, and Updates

🧰 Vinicius Stock shared a new Release v0.3.7. Read the changelog

🧰 Donn Felker shared their template for running Middleman with Tailwind 3 middlemanapp-tailwindcss-template: A Middleman Template that includes support for Tailwind CSS 3+

🧰 Brad Gessler shared the release of Sitepress 4.0. You can see how this is used to power Joe Masilotti blog in this Github repo

🧰 Joel Drapper shared a new release of literal_enums 2.0

🧰 Seth shared a new gem called fruit_juice:

FruitJuice is a job enqueuing adapter for theΒ mosquito background job processorΒ written inΒ Crystal. If you're here to find out how to enqueue background jobs from Ruby/Rails and have them processed in Crystal, you've come to the right place!

Source: https://github.com/crimson-knight/fruit_juice

🧰 Jeremy Evans published a new release of Roda 3.63.0 Read the release notes

🧰 Greg Molnar published a new gem called prepper:

Prepper is a simple server provisioning tool, built on top of SSHKit. You can use it to script your server build process.

Source: https://github.com/gregmolnar/prepper

🧰 Janko MarohniΔ‡Β shared that rodauth-rail will support tailwind:

Source:Β @jankomarohnic

🧰 Janko MarohniΔ‡Β shared a hanami-rodauth-example repository


🀝 Related (but not Ruby-specific)

🀝 Drew Bragg shared a piece of learning about design decisions:

Sometimes we made the best design decision we could at the time, with the information we had, and only now realize it was wrong and that's ok. The key is to owe it and correct the direction of your code. Not support it with more bad decisions out of fear of being "wrong".
Source:Β @DRBragg

🀝Ryan Bates shared a metaphor about building software:

Software development is like casting a 3D object onto a 2D plain. Attempting to model every aspect of a complex domain can become a mess. First choose an angle and build a beautiful representation of the domain that is intentionally limited for the software medium.
Source:Β @rbates

🀝Dan Koe shared a nice image showing the difference between focused work and distracted work:

4 hours of focused work is better than 8 hours of distracted work. My 10 commandments of The 4 Hour Workday
Source:Β @thedankoe

🀝 Miron Marczuk shared a thread about how to grow to senior level:

Source:Β @m_marczuk

There are a lot of good points in the thread. I am adding here only two of them that talks about senior skills:

Source: @m_marczuk

🀝 Jason Swett shared an advice to focus on environment:

Source:Β @JasonSwett

🀝 Nate Hopkins shared a nice way of looking at Best Practices:

Source:Β @hopsoft

🀝 Nate Berkopec shared a piece of wisdom about processes and failure:

"Someone made a mistake" is not a root cause. "This process allowed this person to make a mistake" is a root cause.
Source:Β @nateberkopec

More content: πŸŽ₯ 🎧 πŸ—ž

Slides

Yukihiro MatzΒ sharedΒ the slides from Noah Gibbs presentation at RubyConfTh: YJIT Resources

Newsletter

πŸ—ž Emmanuel HayfordΒ published a new edition of This Week in Rails:Β Documentation on preloading STIs, TimeHelpers improvement, etc

πŸ—ž Women on Rails published a new edition of their International Newsletter #41

πŸ—žΒ Ruby RadarΒ published a new edition:Β Ruby Radar #81

πŸ—žοΈΒ Ruby WeeklyΒ published a new edition:Β Ten days till Ruby 3.2..

πŸ—žοΈΒ Ruby LibHuntΒ published a new edition of theΒ Awesome Ruby Newsletter

Podcasts

🎧 Jason Swett published a new episode from Code with Jason "Vanilla Rails is Plenty" with Jorge Manrubia of 37signals

🎧 The Ruby on Rails Podcast published a new episode Episode 448: Turbo Native Workshop with Joe Masilotti

🎧 Ruby For All published a new episode about The Holidays - Unleash Your Empathy and Spread Good Cheer

🎧 Remote Ruby published a new episode Active Record Cookbook & Making Bomb Rails Apps

Videos

πŸŽ₯ Drifting RubyΒ sharedΒ a new video Episode 379 - Cloudflare Turnstile

πŸŽ₯ Creston JamisonΒ shared a new episode aboutΒ Scaling Postgres Episode 245 ENUMs vs Check Constraints, Faceting With Roaring Bitmaps, Better Scaling, In DB Business Logic

πŸŽ₯ Andrew AtkinsonΒ sharedΒ an old (2016) videos about Postgres Open 2016 - Identifying Slow Queries and Fixing Them!

πŸŽ₯ Emily SampΒ published a video of herΒ Solving Advent of Code with Ruby and Sorbet

πŸŽ₯ CJ Avilla shared a series of videos solving Advent of Code 2022 with Ruby:

  • πŸš€ spaceship operator, rope bridge (snake)

  • Enumerator, CRT display

  • Monkey class

  • Hill climb algorithm

  • Distress signal, pattern matching, eval, method

  • throw, catch, heredocs for Regolith Reservoir

You can check the entire list in the videos section on his website

πŸŽ₯ Drifting RubyΒ published the video ofΒ This Week in Rails - Dec 16th, 2022

πŸŽ₯ Tom StuartΒ published a new episode ofΒ Making a WebAssembly interpreter in Ruby, part 23

πŸŽ₯ Avdi GrimmΒ shared the first episode of RubyTapasΒ Binary Literals in Ruby

πŸŽ₯ DeaninΒ published a new video aboutΒ Sidekiq Background Jobs With Admin Dashboard | Ruby On Rails 7 Tutorial

Articles

Jason CharnesΒ sharedΒ a new article they wrote about Rails’ safety mechanisms

Aurelie Verrot wrote an article about Globalization

Stan LoΒ published a new article describingΒ What's new in Ruby 3.2's IRB?

ThoughtbotΒ shared an article written by Stefanni Brasil aboutΒ How to Fix Rails 6.1 'Initialization autoloaded the constants' Warning Messages

Adrian MarinΒ sharedΒ an article about how to Sort a Ruby array

Kevin Newton continued to write Advent of YARV:

  • Advent of YARV: Part 12 - Global variables

  • Advent of YARV: Part 13 - Constants

  • Advent of YARV: Part 14 - Branching

  • Advent of YARV: Part 15 - Defining classes and modules

  • Advent of YARV: Part 16 - Defining methods

  • Advent of YARV: Part 17 - Method parameters

  • Advent of YARV: Part 18 - Super methods

The Ruby DevΒ sharedΒ an article about Happy Seeding with Faker

Scott WatermasyskΒ sharedΒ a short article about Rails and Docker

The Ruby DevΒ shared an article written by GΓ‘bor SzabΓ³ aboutΒ Simple HTTP GET requests using Ruby

Andrew Atkinson sharedΒ an article about PostgreSQL, Ruby on Rails, Rails Guides

Ruby Lib HuntΒ shared an article aboutΒ Ruby 3.2 introduces Enumerator#product

The Ruby DevΒ shared a new article aboutΒ Rails Generator Cheat Sheet

Andrew Hodson shared an article aboutΒ HTML5 Canvas on Rails? Part 1

Ryan Garver shared an article written by Avdi Grimm about Mastodon: Zero to Green Tests Locally


Thanks for reading Short Ruby Newsletter! If you enjoyed this and want to receive the newsletter weekly in your inbox, consider subscribing:

6
Share this post

πŸ‘‹ Short Ruby News - edition #23

newsletter.shortruby.com
Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

Β© 2023 Lucian Ghinda
Privacy βˆ™ Terms βˆ™ Collection notice
Start WritingGet the app
Substack is the home for great writing