Short Ruby Newsletter

Share this post

👋 Short Ruby News - edition #23

newsletter.shortruby.com

👋 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

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:

Share this post

👋 Short Ruby News - edition #23

newsletter.shortruby.com
Previous
Next
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 Lucian Ghinda
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing