Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Aha! Blog 

New Ways To Customize Tables in Whiteboards

New enhancements to tables in whiteboards make it easier to organize complex information. Enter text directly into cells, merge cells together, and adjust the width of borders.
Posts on Kevin Murphy 

Ruby on Rails Podcast Co-Host?!?

The Ruby on Rails Podcast 🔗

I co-hosted episode 488 of The Ruby on Rails Podcast. Brittany and I talked with Allison McMillan and Chelsea Kaufman about all the plans for RubyConf 2023.

All the thanks to Brittany Martin for asking me to join. I didn’t have podcast hosting on my career bingo card.

Short Ruby Newsletter 

Short Ruby News - Edition #56

Discover the world of Ruby in this comprehensive newsletter covering week 31 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
Short Ruby Newsletter 

Short Ruby News - Edition #57

Discover the world of Ruby in this comprehensive newsletter covering week 34 and part of week 35 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
Short Ruby Newsletter 

Short Ruby News - Edition #58

Discover the world of Ruby in this comprehensive newsletter covering week 35 and part of week 35 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
Short Ruby Newsletter 

Short Ruby News - Edition #59

Discover the world of Ruby in this comprehensive newsletter covering week 36 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.
GoRails Screencasts 

Base62 Decoding Short Codes

Decoding our Base62 encoded short codes is the next challenge
AkitaOnRails.com 

[Akitando] #145 - 16 Linguagens em 16 Dias: Minha Saga da Rinha de Backend

A Rinha de Backend que aconteceu em Agosto de 2023 foi muito divertida. Eu só fiquei sabendo quando acabou, mas não quer dizer que não pude me divertir. Hoje quero resumir tudo que eu fiz nos 16 dias seguintes do evento, detalhes sobre os projetos dos participantes, a controvérsia do Ranking de Linguagens, quais os truques por trás dos vencedores, e como você também poderia ser um vencedor!

Finalmente vou demonstrar o que significa "ser promíscuo" com linguagens de programação. Vamos entender porque como de fato ler um ranking. E como podemos fazer TODO MUNDO alcançar o primeiro lugar do Rust!

Conteúdo

  • 00:00:00 - Intro
  • 00:01:41 - CAP 01 - As Regras - Requerimentos da Rinha
  • 00:09:46 -…
The Rails Tech Debt Blog 

i18n Gem Gotchas in Ruby 3.0: What You Need to Know

If you are using the i18n gem with Ruby 3.0 or are planning to upgrade Ruby to 3.0 while using the i18n gem, this blog post will cover a gotcha that can be tricky to understand.

The problem

Suppose you are using the i18n gem in an application and the code has some logic depending on Ruby’s frozen? method, then you would see totally different behavior in Ruby 2.7 and in Ruby 3.0.

Take a look at this code snippet when run in Ruby 2.7

# Ruby 2.7
a = I18n.t("user.title")
a.frozen?
=> false

b = a.clone
b.frozen?
=> false

Here the translated result stored in variable a is not frozen. And when we clone the object a, the cloned object is also not frozen.

Now let’s take a look at the same…

Aha! Blog 

When Product Teams Should Collaborate in Real Time vs. Asynchronously

Most remote teams rely on a mix of real-time and asynchronous collaboration. Knowing when to leverage each type (and when to use both) is key to more fruitful collaboration.
Gusto Engineering - Medium 

Breaking Down the GraphQL Monolith and Automating Developer Workflows through Rails Generators

Introducing changes to complex systems

At Gusto, there has been a big push to think about modularization at every step of the development process. Whether it’s driving features in the monolith through the use of packwerk, or adopting yarn workspaces in our front-end code, modularization has been a key initiative to help scale feature development at Gusto.

The decision to adopt GraphQL as the communication protocol between the frontend and backend was made in order to harness its inherent advantages. GraphQL offers a significant degree of freedom and flexibility, enabling developers to craft requests tailored to specific client use cases, ultimately enhancing the efficiency and precision of…

The Ruby on Rails Podcast 

Episode 488: Rubyconf 2023 Preview with Allison McMillan and Chelsea Kaufman

Special co-host Kevin Murphy joined Brittany this week to interview Allison McMillan and Chelsea Kaufman, co-chairs of the upcoming Rubyconf 2023 happening in San Diego. The quartet discussed lessons learned from Railsconf 2023, the approach to thinking about and planning this year's Rubyconf and what is new and different at the event.

Show Notes:

Sponsored By:

Honeybadger

If you want to simplify your stack, and lower your bills, it’s time to check out Honeybager. Honeybadger combines all of those services into one easy to use platform—it’s everything you…

Greg Molnar 

Deploying a Rails app with Kamal

This is an updated version of the post I wrote about MRKS in the past.

Ruby Magic by AppSignal 

An Introduction to Sidekiq for Ruby on Rails

Sidekiq allows Ruby developers to maintain fast and responsive web applications by moving time-consuming tasks into the background.

With multithreading at its core, Sidekiq can process many jobs at once. This makes Sidekiq an important part of Ruby or Rails applications that handle heavy loads or perform tasks like sending emails or processing files. Without background processing, long-running tasks would block your application's main thread, resulting in slow response times and a poor user experience.

In this post, we'll focus on effectively utilizing Sidekiq to manage and process background jobs.

Let's get started!

The Basics of Sidekiq

In essence, Sidekiq is a full-featured background…

GoRails Screencasts 

Base62 Encoding Short Codes

Using Base62, we can take an Integer ID and compress it for short codes in our URLs
Aha! Blog 

A Fresh Look for the Features Roadmap

Elevate your product plans in Aha! Roadmaps with the refreshed features roadmap. Enjoy enhanced styling, updated timeline controls, and new customizations.
Rails at Scale 

Ruby 3.3’s YJIT Runs Shopify’s Production Code 15% Faster

Ruby 3.2 YJIT has optimized the production workloads of Shopify and other companies. We encourage you to enable YJIT in production. Once Ruby 3.3 is released, it should make your application even faster.
RubyGems Blog 

August 2023 RubyGems Updates

Welcome to the RubyGems monthly update! As part of our efforts at Ruby Central, we publish a recap of the work that we’ve done the previous month. Read on to find out what updates were made to RubyGems and RubyGems.org in August.

RubyGems News

This month in RubyGems, we released 3.4.18, 3.4.19 and Bundler 2.4.18, 2.4.19.

In RubyGems, we improved the documentation performance by speeding up the build process when updating RubyGems - #6864. We added a poller to fetch WebAuthn OTPs - #6774, added a file option to the Ruby method in the Gemfile - #6876 and removed some side effects when unmarshalling old Gem::Specifications- #6825.

Some other improvements that landed into our repo this…

Test Double 

Why listening should be a recruiter's number one tool

We’ve likely heard this advice throughout our lives: listen more than you talk. In a world of social media, influencers, and seemingly constant opinions and arguing, listening gets put on the back burner, and the focus is all about talk.

That can be especially true for recruitment, a career where conversing with people is often viewed as the central theme. It’s a bit of a stereotype, but recruiters can be notorious at tech and software engineering events for being the loudest people in the room—pushing conversations on others without noticing how the people they’re speaking with are uninterested in what they’re trying to say. Ever pushing, needing to talk, talk, talk. This sales-y…

GoRails Screencasts 

Creating The Link Model

First things first, we need a Link model to store our
The Bike Shed 

402: Musings on Mentorship

Joël describes an old-school object orientation exercise that involves circling nouns in a business problem description. The purpose is determining which nouns could become entities or objects in a system. Stephanie shares she's working from the Hudson Valley in New York as a trial run for potentially relocating there. She enjoys the rail trails for biking and contrasts it with urban biking in Chicago.

The conversation between Joël and Stephanie revolves around mentorship, both one-on-one and within a group setting. They introduce a new initiative at thoughbot where team members pair up with principal developers for weekly sessions, emphasizing sharing perspectives and experiences.

Ruby Central 

Applications Now Open to Join the Board of Ruby Central!

Ruby Central is a non-profit organization dedicated to support and advocacy of the worldwide Ruby community.

We produce the annual RubyConf and RailsConf conferences, support community growth, and provide vital infrastructure for the Ruby programming language by maintaining the bundler and rubygems packaging services in addition to other open source projects.

The board of directors for Ruby Central act as representatives to the community and work to ensure smooth operations today and smart strategy for tomorrow. We meet once a month and all take turns working as co-chairs of the conferences.

To support our conferences and programs, we're looking to fill multiple board seats! We'd love to have…

GoRails Screencasts 

Normalizes method in ActiveRecord

Normalizing data has always been a pain in Rails, but not anymore! Instead of callbacks or overriding setters, Rails 7.1 introduces "normalizes" to make normalizing data easy.
Ruby on Rails 

Rails Foundation Seeks Freelance UX Designer and Technical Writer

One of the primary goals of the Rails Foundation is to improve the Rails documentation for both new and existing users. We have a lot of ideas about how to achieve this, and we are now ready to start tackling this with the help of an experienced UX designer and a technical writer (or two) with a strong Rails background.

These two roles will have a lot of opportunity for cross-collaboration to find (and close) gaps in the current content. Both roles will also work closely with members of the Rails Core and Issues team as well as volunteers from the Rails community to understand the needs and pain points of Rails users.

Here are some of the projects that you could be working on:

  • Updating…
BigBinary Blog 

Rails 7.1 adds support for multi-column ordering in ActiveRecord::Batches

In Rails 7.1, an enhancement has been introduced toActiveRecord::Batchesmethods, related to models with composite primary keys. This update allowsdevelopers to specify ascending or descending order for each key within acomposite primary key.

Before Rails 7.1

In Rails versions prior to 7.1, when batch processing records with a compositeprimary key, like id_1 and id_2, developers could use the :asc or :descargument to control the sorting order. However, there was a limitation in howthis sorting worked. When you specified the sorting order using :asc or:desc, it affected both id_1 and id_2 simultaneously. In other words, ifyou requested ascending order, both id_1 and id_2 would be sorted…

GoRails Screencasts 

URL Shortener Requirements

We're going to build a URL Shortener in Rails, so where do we start? In this lesson, we'll plan out our project and the features we want to build.
Island94.org 

In defense of consensus

There’s a style of reactionary meme that takes a photo of like, empty store-shelves or a trash-strewn street, and applies the image macro “This is what Communism looks like”. But upon closer inspection (and social media lampooning), it’s a photo of America, capitalist America, very much not under communism. We’ll come back to this.

Let’s talk about “consensus”. Not a week goes by in my Bay Area tech worklife where I don’t read or hear someone dragging consensus. Consensus is pilloried: weak, indecisive, lowest-common denominator, unclear, drawn out… consensus is bad, they say.

Working in tech for a decade, I have to admit this struck me as strange the first time I heard a coworker…

Honeybadger Developer Blog (Ruby Articles) 

Building a Sinatra app in Ruby

Sinatra is a lightweight web application framework written in Ruby. It provides a simple and easy-to-use syntax for building web applications. The framework focuses on being minimalistic, allowing developers to quickly create web applications without having to deal with a lot of the boilerplate code and relatively rigid way of doing things that accompany larger and more popular frameworks like Rails.

In this article, we'll use the Sinatra framework to build a simple URL-shortening app where a user can input a long URL and generate a short URL that redirects to the original URL when clicked. The app will also have a feature for keeping track of how many times a shortened URL is clicked.

Ta…

Akshay's Blog 

How to Debug and Step-Through Rails Codebase

💡
I originally wrote this post two years ago, which showed the usage of the pry-byebug gem. Since then, I've switched to the debug gem for all my Ruby debugging needs, and hence re-publishing the updated post.
How to Debug and Step-Through Rails Codebase

Reading the source code is a great way to understand how a feature works in Rails. However, stepping through the specific Rails method you're interested in is even better. You can inspect the local variables, follow the conditional path, and learn exactly what's happening behind the scenes.

This post shows how you can debug and step-through the Rails codebase for a better understanding of the framework.


Recently, while researching the authenticity tokens in Rails, I wanted to learn how…

RubySec 

CVE-2023-26141 (sidekiq): sidekiq Denial of Service vulnerability

Versions of the package sidekiq before 7.1.3 are vulnerable to Denial of Service (DoS) due to insufficient checks in the dashboard-charts.js file. An attacker can exploit this vulnerability by manipulating the localStorage value which will cause excessive polling requests.
Posts on Kevin Murphy 

Building Conference Talk Content

Conference Talk Preparation Series 🔗

  1. Sharing Past Conference Proposals
  2. Building Conference Talk Content

Have you recently had a conference proposal accepted? Congratulations! Are you wondering, “what do I do now?” Here is the process I follow to turn my proposal into a full-length talk.

Content Generation 🔗

My first step is to gather all the content I want to talk about as quickly as possible. I know that sounds reductive. Oh, the first step is JUST to put together all your content? How easy! I might as well tell you how to draw an owl next.

But, here’s the thing - for a conference talk, I’m not starting from scratch. I’ve already put a lot of time, and thinking, into the proposal. For me, that…

Aha! Blog 

Product All-Star: 6 Questions With Anthony Chamy

Anthony Chamy is a digital portfolio strategist at CAE, a world leader in training and simulation in the fields of civil aviation, defense and security, and healthcare. Read why he believes an entrepreneurial spirit is vital to product management success.
Once a Maintainer 

Once a Maintainer: Felienne Hermans

Welcome to Once a Maintainer, where each week we interview an open source maintainer and tell their story.

This week we’re talking to Felienne Hermans, professor of computer science at the Vrije Universiteit Amsterdam and creator of Hedy, a progressive programming language designed for kids 10 and up and for teachers to use in the classroom.

Once a Maintainer is written by the team at Infield, an app that helps engineering teams manage complex open source dependency upgrades. We spoke with Felienne from her home in the Netherlands.

How did you become a programmer?

Probably when I was about six, we had a computer in the house. Immediately I enjoyed playing with the computer, making the…

Ruby on Rails 

This Week in Rails: 7.1 beta release, Bun support and more!

Hi, it’s Greg, bring you the latest changes in the Rails codebase.

Rails 7.1 beta release
The first beta version of Rails 7.1 has been released! There have been over five thousand commits made by over 800 contributors since Rails 7.0, so this release is packed with new features and improvements. You can read a summary of the changes in the announcement.

Ignore env files (except templates)
To prevent accidentally leaking secrets to code repositories, the default .gitignore file excludes .env(except template ones) files from now on.

Explicit primary_key: option should always take priority in associations
This pull request fixes the issue where the primary_key: option was ignored if the…

Remote Ruby 

There's A TypeScript In My Boot!

On today’s episode, Jason, Chris, and Andrew start off with a captivating discussion that starts with bleeping offensive content, reminiscing about the era of Walkman’s, and hearing about Andrew’s absence from social media. The conversation then shifts to the announcement of the removal of TypeScript and exploring the challenges and community dynamics surrounding it. The guys share their experiences with TypeScript, communication challenges in open source projects, and the importance of maintaining a positive and respectful community. Additionally, they touch on recent announcements related to software source code and a humorous incident involving law enforcement.  They also have…

All about coding 

How to create a new Rails app running Rails 7.1 beta or main branch

New app with Rails 7.1.beta1

Here is how to create a new Rails app that runs on Rails 7.1 beta1

gem install -v 7.1.0.beta1 rails

rails _7.1.0.beta1_ new myrails71app

Replace myrails71app with your own app name and you are good to go.

This will generate a Gemfile that has something like this inside and then install required gems for Rails 7.1.0.beta1

# Gemfile

gem "rails", "~> 7.1.0.beta1"

New app with Rails main branch

Here is how to create a new Rails app that runs on Rails main branch from GitHub:

rails new myrailsapp --main

This will generate a Gemfile that has something like this inside:

gem "rails", github: "rails/rails", branch: "main"

May you have a lot of ideas to try!


Enjoye…

Awesome Ruby Newsletter 

💎 Issue 382 - It’s dangerous to go alone: take our guide to the “IDEAL” HTTP client! (With examples in Ruby)

Julia Evans 

In a git repository, where do your files live?

Hello! I was talking to a friend about how git works today, and we got onto the topic – where does git store your files? We know that it’s in your .git directory, but where exactly in there are all the versions of your old files?

For example, this blog is in a git repository, and it contains a file called content/post/2019-06-28-brag-doc.markdown. Where is that in my .git folder? And where are the old versions of that file? Let’s investigate by writing some very short Python programs.

git stores files in .git/objects

Every previous version of every file in your repository is in .git/objects. For example, for this blog, .git/objects contains 2700 files.

$ find .git/objects/ -type f |…
Aha! Blog 

Introducing Inline Comments in Whiteboards

Engage in threaded discussions with teammates you can now add and respond to comments directly in whiteboards in Aha! software.
Ruby Weekly 

A Ruby 3.3 preview and Rails 7.1 beta

#​669 — September 14, 2023

Read on the Web

Ruby Weekly

Ruby 3.3 Preview 2 Released — With Christmas Day as the traditional day that new versions of Ruby land, things begin to pick up in the fall. Major performance improvements over 3.2 are already on offer thanks to ongoing improvements with YJIT, but there’s also an optional experimental pure-Ruby JIT compiler called RJIT to try.

Yui Naruse

'We Turned Lobste.rs into a Benchmark for YJIT' — Related to my comments (above) on how YJIT is continuing to get faster and faster, Noah Gibbs has some real world data on just how well YJIT, the default JIT in…

Saeloun Blog 

Set And Restore Public Attributes Around a Block Using Object#with

Object#with(**args) method is not part of the Ruby standard library. Thanks to Rails, it’s a convenience method added to the Object class to manage object states.

def test_posts_when_user_is_verified
  user.with(verified: true) do
    # Perform posts testing
  end
end

Before

Saving the value of an attribute, setting a new value, and then restoring the previous value in an ensure clause is a fairly popular pattern in Ruby, particularly in testing or in api calls

def test_posts_when_user_is_verified
  old_value = user.verified
    user.verified = true
    # Perform posts testing
  ensure
    user.verified = old_value
end

This is a common and popular pattern as everything works fine in…

Ruby on Rails 

BigBinary joins the Rails Foundation

Please help us welcome BigBinary as the newest Contributing member of the Rails Foundation!

For more than twelve years, BigBinary has built custom web applications for clients using Ruby on Rails. Recently, they also launched neeto, an impressive suite of productivity tools all built on Rails. Over the past decade, the team has made many contributions to the Rails codebase and is active in the Rails community- organizing meet-ups, sponsoring events like Rails Girls, and speaking at various Ruby and Rails conferences around the world.

At BigBinary, we all love working with Ruby on Rails, and find it incredibly productive. Without it, it wouldn’t be possible for us to build neeto,…

Ruby News 

Ruby 3.3.0-preview2 Released

We are pleased to announce the release of Ruby 3.3.0-preview2. Ruby 3.3 adds a new pure-Ruby JIT compiler named RJIT, uses Lrama as a parser generator, and many performance improvements especially YJIT.

RJIT

  • Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT.
    • RJIT supports only x86_64 architecture on Unix platforms.
    • Unlike MJIT, it doesn’t require a C compiler at runtime.
  • RJIT exists only for experimental purposes.
    • You should keep using YJIT in production.
  • If you are interested in developing JIT for Ruby, please check out k0kubun’s presentation on Day 3 of RubyKaigi.

Use Lrama instead of Bison

Akshay's Blog 

The Complete Guide to Working With Cookies in Rails

🎁
If you want to work with Hotwire and are based in USA, California-based virtual-inspection software company Sitewire is looking for a new Rails developer to join their team.

In addition to Rails, they use Hotwire (Turbo + Stimulus) and TailwindCSS, which in my opinion is the best tech stack to build web applications in 2023. Check out their job opening for the Full-stack Rails Engineer role. It's remote (only in the US), and if you think you’re a suitable candidate, get in touch with Justin.
The Complete Guide to Working With Cookies in Rails

You must have seen those cookie banners on most websites nowadays. Ever wondered what cookies are and why websites use them?

In this chapter, we're going to learn almost everything you need to know about…

GoRails Screencasts 

Rails 7.1 Authentication From Scratch

Rails 7.1 introduces many new features for authentication. In this lesson, we'll show you how to implement authentication from scratch using Rails 7.1's new features.
Aha! Blog 

How To Set Your 2024 Product Strategy

Ready to set strategy and plan your 2024 product roadmap? These are the areas of focus that will guide any product manager towards success. It starts with developing a "goal-first" mindset.
Ruby Rogues 

Stimulus, Hotwire, and Turbo, Oh My! - RUBY 607

If you’re wondering how to make sense of all these frameworks, you’ve come to the right podcast. In this episode, the Rogues dive DEEP into the pros and cons of Stimulus, Hotwire, Turbo, React, Rails, and more; why certain communities are divided amongst each other (and how to fix it); and what tools you NEED to try in 2022.

In This Episode

This tendency in the Rails community that reveals why users are slow to try Hotwire

 What Charles learned from comparing React vs. Stimulus at his old job (and how Rails came to the rescue)

 Why those in the Java community are seeing React as a “blackhole that’s sucking up everything” (and why some of the Rogues disagree)

 Up and coming frameworks that you…

The Ruby on Rails Podcast 

Episode 487: Building the Rails World Application with Shami Tomita and Eric Halverson

Rails World needed a website! Did you want to be on the small team that helps build it? Shami Tomita and Eric Halverson certainly did and so they came on to the show to talk about their experience and the tech stack behind the conferencing app. Backed by Daniel Rassiner and Cody Norman, the crew talked about supporting Juniors and conference tips.

Show Notes:

Sponsored By:

Honeybadger

If you want to simplify your stack, and lower…

Hi, we're Arkency 

Six ways to prevent a monkey-patch drift from the original code

Six ways to prevent a monkey-patch drift from the original code

Monkey-patching in short is modifying external code, whose source we don’t directly control, to fit our specific purpose in the project. When modernising framework stack in “legacy” projects this is often a necessity when an upgrade of a dependency is not yet possible or would involve moving too many blocks at once.

It’s a short-term solution to move things forward. The reward we get from monkey-patching is instant. The code is changed without asking for anyone’s permission and without much extra work that a dependency fork would involve.

But it comes with a hefty price of being very brittle. We absolutely cannot expect that…

All about coding 

Using GPT-4 to refactor a simple HTML page

Continuing with my endeavour of publishing more about using GPT-4 while coding, here I am going to show you how I refactored some HTML when writing the homepage for ShortRuby.com

Note: When I am writing in this text GPT-4 I want to say that I am using Cursor IDE with GPT-4 option.

First, this is the result. I am pretty happy with it as I spent little time making it and it was a small iteration. This will probably evolve over the next weeks thus it is better to capture here how it looks like at the end of this coding session:

Adding the logo to the top left

After I created a very simple hero section that contained the title and a description I wanted to add a logo to the left side.

The…

Ruby on Rails 

Rails 7.1 Beta 1: Dockerfiles, BYO Authentication, More Async Queries, and more!

Rails World is fast approaching and we’re gearing up to celebrate the 20th anniversary of Rails in style with the first beta release of Rails 7.1! There has been over five thousand commits made by over 800 contributors since Rails 7.0, so this release is packed with new features and improvements.

Please help us test all this new stuff, so we can ensure a solid final release of Rails 7.1 for the birthday party 🎉

Dockerfiles for new applications

Rails will now generate all the Dockerfiles you need to deploy your application using Kamal, or any other Docker-based deployment setup, when you run rails new. These Dockerfiles are tuned for production use with proper caching layers, multi-stage…

The Ruby Dispatch 

Sqlite & Rails in Production

When deploying a Rails application to production, its rare to question the idea of running a Postgres or MySQL database to persist data and Redis for caching, background job processing, and WebSockets, but what if it could all be done without running these services?

“No part is the best part”, right? Here’s the thing, Redis and Postgres run as separate processes that need to be monitored. Usually these processes are running on a separate server that’s accessed over a network connection, which can also break. You’ll either have to deal with that complexity yourself or pay to have it managed with services like Upstash Redis.

What if we could run everything on one server and not have to…

Shopify Engineering - Shopify Engineering 

Building a ShopifyQL Code Editor

The Rails Tech Debt Blog 

Exploring Ruby Warnings

We are used to checking the deprecation warnings displayed by Rails or warnings from different gems, but Ruby itself can also display warnings to help us find code that can be problematic.

In this article we will explore how to use them, how to analyze them, and some examples of interesting warnings that can be really helpful during upgrades.

Enabling Ruby Warnings

Warning Options

The ruby command accepts the -w and -W arguments that will enable the highest level of verbosity for warnings.

Verbosity Levels

The -W argument also accepts a verbosity level value:

  • -W0 means warnings are completely disabled by setting $VERBOSE = nil
  • -W1 means important warnings are displayed by…
Aha! Blog 

A New Way To View a Customer's Linked Ideas in Salesforce

Account pages in Salesforce now show all linked ideas even if they come from a related opportunity or case. Give your sales and support teams one convenient view of customer requests.
Test Double 

The undeniable power of the career-changer

Tech has a well-known, oft-mentioned problem: the barrier to entry is an enormous, looming, and often confusing challenge. This problem has only expanded in our current economic climate. The internet is riddled with how-to courses from self-appointed LinkedIn influencers— promising to show you all the tips and tricks for only $250, with titles like “How to break into tech: a guide for career changers”*. Twitter (or are we calling it X now?) is full of opinions on what job seekers “should” be doing, with a particular focus on entry-level, career-changing engineers.

*I made this title up

If someone read all of these opinions, they would likely be overwhelmed. These so-called experts…

Rails, PostgreSQL Performance Audit and Tuning Consultant for Hire 

How to Improve Rails Caching with Brotli Compression

Caching is an effective way to speed up the performance of Rails applications. However, the costs of an in-memory cache database could become significant for larger-scale projects. In this blog post, I’ll describe optimizing the Rails caching mechanism using the Brotli compression algorithm instead of the default Gzip. I’ll also discuss a more advanced technique of using in-memory cache for extreme performance bottlenecks.

Brotli vs Gzip 101

In one of my previous posts, I’ve covered how Rails leverages compression algorithms for the HTTP transport layer. Please check it out for more details on how Gzip and Brotli differ in compression ratios and performance. Here, let’s quickly recap the…

You can use…

dmitrytsepelev.dev 

Ruby goes to the movie theater: directing the refactoring of your application

This post introduces a method I use to refactor big applications. I want the process to happen in a predictable manner and make sure that important things are addressed before others. One day I realized that there is a missing tool in my workflow, so I’ll introduce my new gem called rubocop_director.

Refactoring as a process

Refactoring is a technique of transforming the code without making changes in its functionality. Why people do that?

Sometimes the way that code written makes it harder for to engineers to improve the performance or add a new feature. Another example is a scenario when application is big and there are many ways to do the same thing or same responsibility is…

The Bike Shed 

401: Making the Right Thing Easy

Stephanie has another debugging mystery to share. Earlier this year, Joël mentioned that he was experimenting with a bookmark manager to keep track of helpful and interesting articles. He's happy to report that it's working very well for him!

Together, they discuss tactics to ensure the easiest route also upholds app health and aids fellow developers. They explore streamlining test fixes over mere re-runs and how to motivate desired actions across teams and individuals.


Transcript:

JOËL: Hello and welcome to another episode of The Bike Shed, a weekly podcast from your friends at thoughtbot about developing great software. I'm Joël…

Giant Robots Smashing Into Other Giant Robots 

Mining Gold in Digital Conversations

Gold Miner is an app I created to transform interesting conversations we have at thoughtbot into blog posts. The articles generated are part of the This week in #dev series, and today I’ll talk about some of the technical details of the app, like how we use artificial intelligence, async Ruby, and other interesting patterns.

The code examples were simplified a little, but you can always read the real thing because it’s open-sourced.

The MVP

The first step was to classify what I thought were “interesting messages”. We share a lot on our public Slack channels, so I decided to search messages containing “tip” or “TIL” in them. To allow people to hand-pick…

Evil Martians, an extraterrestrial product development consultancy 

It’s dangerous to go alone: take our guide to the “IDEAL” HTTP client!

Authors: Artur Petrov, Backend Engineer, and Travis Turner, Tech EditorTopics: Backend, Full Cycle Software Development, Microservices, Ruby, Ruby on Rails

Essential techniques to ensure your HTTP clients are robust and configured to avoid pitfalls and insights on the benefits of separating the client code layer from the app. This guide isn't limited to backend apps (although most examples are in Ruby), the same principles work for any language and platform, even frontend.

Welcome, digital explorer, to the vast terrain of microservices. Whether you're navigating these challenging lands on your own, or comfortably residing in the serenity of a monolithic architecture, an HTTP client is an…

Mike Perham 

Ruby HTTP Server from scratch

Recently I decided to add support for Kubernetes HTTP health checks to Sidekiq Enterprise. This means, within each Sidekiq worker process, we need to implement an HTTP server which listens on port X and simply returns 200/OK if the process is alive. Notice we have really basic requirements here: no need for serving files or arbitrary dynamic content. We only respond to “/” so there’s no need for routes, paths or query parameter handling.
JRuby.org News 

JRuby 9.3.11.0 Released

The JRuby community is pleased to announce the release of JRuby 9.3.11.0

JRuby 9.3.x is compatible with Ruby 2.6.x and stays in sync with C Ruby. As always there is a mix of miscellaneous fixes so be sure to read the issue list below.

Thank you to our contributors this release, you help keep JRuby moving forward! @ahorek, @chadlwilson, @justinstoller, @k77ch7, @kares, @snoglobe

Ruby Compatibility

Standard Library

  • strscan is still built-in (not a gem) but has been updated to the 3.0.6 version. #7634, #7884, #7889
Getaround Engineering 

JPEG and EXIF Data Manipulation in Javascript

The Exchangeable Image File Format (EXIF) is a standard that specifies formats for images and sounds. It stores technical details through metadata, data that describes other data, such as the camera make and model and the date and time the image was taken.

Initially, EXIF was used for two image formats, JPEG and TIFF. But today, other file formats such as PNG, WEBP, or HEIC also support EXIF for metadata.

This article will focus on the JPEG format. In the first part, we will explore its structure before seeing how to read and update associated metadata through Javascript in a browser environment.

Before moving on, it is essential to review some key concepts:

📌 What is the 0x notation? 0x

Andy Croll 

Express yourself clearly with positive? and negative? for numbers

Ruby, in contrast to other languages, often provides multiple ways to accomplish simple programming tasks. In pursuit of developer happiness, the Standard Library offers the opportunity to make your code appear more like English.

In this case we’ll look at comparing numbers with zero.

Instead of…

…using comparison operators:

if number > 0
  # do a thing
end

if number < 0
  # do a thing
end

Use…

…Ruby’s convenience methods on Numeric, and its subclasses, to express yourself more clearly:

if number.positive?
  # do a thing
end

if number.negative?
  # do a thing
end

Why?

I’ve discussed my preference for a similar comparator, zero?, in a previous article.

The “more English”…

Ruby on Rails 

Rails 7.0.8 has been released

Hi everyone,

I am happy to announce that Rails 7.0.8 has been released.

CHANGES since 7.0.7

To see a summary of changes, please read the release on GitHub:

7.0.8 CHANGELOG To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as…

Akshay's Blog 

Rails Middleware: (Almost) Everything You Need to Know

💡
This is the eighth article in the series on building a web application in Ruby without using Rails. In the previous article, we added support for logging, and this one shows how to extract the logging functionality to a middleware, to keep our application free from peripheral concerns.
Rails Middleware: (Almost) Everything You Need to Know

Most web applications have some functionality that's common for many (or even all) HTTP requests. For example, an application will authenticate the user and log the incoming HTTP request, add new headers, or check if the request is for a static file and serve it from a CDN without hitting the app server.

Middleware is an elegant way to organize this common functionality, instead of spreading it everywhere in…

Ruby on Rails 

Infer primary_key: :id on associations with composite primary key models, add validation option for enum and more!

Hi! This is Vipul bringing you the latest from this week’s changes in the Rails codebase.

Infer primary_key: :id on associations with composite primary key models

Prior to this change, you’d need to do the following to set up associations for composite primary key models:

class Order
  self.primary_key = [:shop_id, :id]
  has_many :order_agreements, primary_key: :id
end

class OrderAgreement
  belongs_to :order, primary_key: :id
end

After this change, the primary_key option no longer needs to be specified:

class Order
  self.primary_key = [:shop_id, :id]
  has_many :order_agreements
end

class OrderAgreement
  belongs_to :order
end

Add validation option for enum to make then…

Ruby Central 

Listen to Ruby Central's André Arko on The Rooftop Ruby Podcast

ICYMI our head of open source André Arko was featured on the Rooftop Ruby Podcast last week! He covered his journey to Bundler, how Ruby Together came to be and how he is continuing this work with Ruby Central. He also shared some developer horror stories – and funny stories too! Enjoy, and please don't hesitate to reach out and let us know what you think.

Aha! Blog 

My Name is Ashley Borg — This Is What I Achieve at Aha!

Ashley is a senior creative manager on the Aha! marketing team. Get her view on what makes her role unique and rewarding plus, expert advice for early-career creatives.
All about coding 

Using Cursor IDE for some small changes in a Rails app

Path of my learning path about how to use AI/LLMs to augment my developer productivity I started using www.cursor.so

Here let me show you how I made two changes to the rubyandrails.info website.

Replacing a form with a Phlex component

The first task that I asked was about replacing an HTML with a component. To achieve this in Cursor (MacOS edition) you have to select the text and then press CMD+K. Then a pop-up will appear where you can ask your question (or write your prompt) like this:

After submitting Cursor (that uses GPT4 in this case under the hood) will make a diff for the selected code and ask you to accept it or not:

I like this idea that it proposed a diff because I can review…

Remote Ruby 

Sorry For Slandering Yet Another Gem

In this episode of Remote Ruby, Jason and Andrew cover a wide range of topics that start out with nothing to do with tech. First, they discuss energy drink flavors and then transition into a humorous exploration of disagreements with Chris, who happens to not be here today. They cover various topics including CMS options, front-end development, and Tailwind CSS customization. They also introduce a gem called “Counter” created by their colleague Jamie, aka “Dad” at Podia, which efficiently handles attribute tracking.  Jason and Andrew discuss the gem’s features and flexibility, highlighting its value in addressing complex counting challenges.  We end with a discussion on email…

Karol Galanciak - Distributed Systems Architect and Ruby on Rails expert 

Smily Engineering Blog

We’ve finally launched Smily (formerly BookingSync) Engineering Blog which I’m going to primarily focus on instead of this blog here. If you enjoyed the content of my personal blog, make sure to check Smily blog as it’s going to be even better!

Awesome Ruby Newsletter 

💎 Issue 381 - DHH joins the show to talk Rails 8, Delegated Types, Kamal and more!

Aha! Blog 

New Ways for Product Managers To Collaborate on Notes and Whiteboards

Now Aha! customers have more options to collaborate with teammates and stakeholders in shared notes and whiteboards at no additional cost.
Ruby Weekly 

DHH says goodbye to TypeScript

#​668 — September 7, 2023

Read on the Web

Normal service has been restored – I'm back from my summer vacation 😅 If you haven't had an issue of Ruby Weekly for a few weeks, it's my fault, not yours, but we're now back all the way through till Christmas.. hopefully. There's a lot to catch up on, so let's go.
__
Peter Cooper, your editor

Ruby Weekly

Ruby Outperforms C: Breaking the Catch-22 — YJIT’s ability to improve performance by adapting to run-time behavior can increase the speed of our code in a way that dropping down to C can’t, demonstrates Aaron. This should encourage us to write as much pure Ruby as possible…

Drifting Ruby Screencasts 

I'm a teapot

A special release to celebrate 418 episodes. I talk about different HTTP response codes.
Ruby Rogues 

Uncovering Unknown Security Issues with Penetration Testing - RUBY 606

Greg Molnar is a Ruby Developer and OSCP Penetration Tester. He joins the show to talk about Penetration Testing. He begins by explaining what it is, how beneficial it can be to the users, its process of securing applications, the actual testing process, and many more!


  1. White box – consultant provided access to source code 
  2.  Grey box – the company gives info to the consultant 
  3. Black box – nothing provided to the consultant


Sponsors


Links


Socials


Picks

VectorLogic Blog 

Machine Learning Using Decision Trees in Ruby

In the era of hyper-sophisticated machine learning models like ChatGPT, it is surprising how effective the classic decision tree model remains, especially when used in conjunction with other techniques, such as bagging, boosting and random forests. In this blog post we demonstrate how to build an effective decision tree model, and train this model on some sample data.
Akshay's Blog 

Let's Read the Turbo Source: What Happens When You Click a Link?

Let's Read the Turbo Source: What Happens When You Click a Link?

If you haven't heard, Turbo 8 is dropping TypeScript.

I used to love TypeScript, but now I prefer plain JavaScript, both for reading and writing. So personally, I am happy with this bold move, even though everyone on the Internet seems to be pissed off.

Anyway, ever since switching to Hotwire two years ago, I've always wondered how Turbo really worked behind the scenes. For example, what really happens when you click the link, how frame-swapping works, etc. Reading the source is one of the best ways I've found to learn how a feature/framework/program works, so when I read David's comment on the PR,

The code not only reads much better, it's also freed of the type wrangling and gymnastics…
Once a Maintainer 

Once a Maintainer: Marc-André Lafortune

Welcome to Once a Maintainer, where each week we interview an open source maintainer and tell their story.

This week we’re talking to Marc-André Lafortune, a longtime contributor to the Ruby and Elixir communities, member of the Ruby and rubocop core teams including the core rubocop-ast engine, and creator of the backports gem.

Once a Maintainer is written by the team at Infield, an app that helps engineering teams manage their dependency upgrades. We spoke with Marc-André from Montreal.

How did you get into programming?

I was really, really young, beginning of the 80’s. My father always really liked new gadgets. I think we were one of the first people in Montreal to get rollerblades at the…

Ruby Central 

Community Day at RubyConf 2023 Highlights Connection, Collaboration & Mentorship

The New Format Allows for Long-term Partnerships & New #RubyFriends

Ruby Central, Inc. announced a completely reimagined format for RubyConf 2023. The 23rd annual Ruby Conference, taking place in San Diego, California, will kick off with Community Day, which is replacing one day of talks. Instead, registrants will attend workshops, collaborate with one another and take advantage of opportunities to meet open source maintainers, including the chance to pair with core teams; Ruby, JRuby, Truffle Ruby, Bundler/RubyGems and more.

“Many of us have #RubyFriends from conferences, but in our day-to-day work, we work in silos,” said Allison McMillan, Co-chair, RubyConf 2023 “This year we wanted to…

The Ruby on Rails Podcast 

Episode 486: High Performance PostgreSQL for Rails with Andrew Atkinson

If you love taking about databases, this is the episode for you. Ahead of the launch of his new book, High Performance PostgreSQL for Rails, Andrew Atkinson joined the show with special guest co-host, Pat Bair, to talk about why he wrote a book, why he focused on PostgreSQL and his favorite feature from the upcoming 7.1 release.

Show Notes:

Sponsored By:

Honeybadger

You won’t know if Honeybadger will really save you time and trouble until you see how it works in your own toolchain. With two lines of code and five minutes, you can see for yourself. Honeybadger automatically hooks into popular web frameworks,…

Ruby Magic by AppSignal 

An Introduction to RuboCop for Ruby on Rails

Good code has a lot to do with how readable it is. As developers, we more often read code than write it. As my Perl teacher told us many times: the flexibility of Perl's syntax was its best and worst trait at the same time. Ruby's syntax was influenced partly by Perl and is also quite flexible.

Whatever language you pick, set some guidelines to avoid overusing a language's flexibility. Style guides for Ruby abound on the web, and it's not difficult to pick a style nowadays. But there is not much point in having copious debates on style and whether a proposed change follows a guide. Style enforcement is best left to a tool.

Such tools are called linters and static code analyzers. The de…

Everyday Rails 

A few things I've learned to simplify working in dev containers

I'm still learning as I go, but here are some tidbits I've learned so far about using dev containers for most of my software projects these days.
Greg Molnar 

Throttling Rails logins with Rack Attack

This week, I will show you how to rate-limit your authentication endpoints with Rack::Attack.

Test Double 

Decoding antipatterns in tech recruiting to find a better way

So many people are frustrated with recruiters, and why wouldn’t they be? Recruitment hasn’t changed a lot over the years. The tools have changed, but the principles of good recruitment vs. bad recruitment stay the same. And all of us have seen examples of bad recruitment.

In 2021, I received the following opportunity:

A recruiter message offering to connect Anya to new pallet jack/forklift positions available for hire immediately. I am not a forklifter

I have no forklift skills, nor have I ever been a forklifter.

If you’ve ever received a similarly mismatched message, you may have started wondering why LinkedIn even exists, why recruiters are so bad at their job, and why the spam filter on Gmail failed you.

Does recruitment have a fighting chance for a better, enlightened reputation? At…

The Bike Shed 

400: How To Search

Joël shares he has been getting more into long-form reading. Stephanie talks about the challenges she faced in a new project that required integrating with another company's system.

Together, they delve into the importance of search techniques for developers, covering various approaches to finding information online.


Transcript:

STEPHANIE: Hello and welcome to another episode of The Bike Shed, a weekly podcast from…

The Rails Tech Debt Blog 

7 common techniques to improve your debugging skills

When we work on Rails upgrades, most of the time we have to solve issues after updating the gems. These problems can go from simple and straightforward to really complex and hard to debug. Here we will discuss different skills and techniques that we use to complete the upgrade.

Basic things which you should always do

  1. Ask yourself and others simple or stupid questions. Try to make sure you know what you are fixing.
  2. Take a close look at an error log or stack trace.
  3. If you are not sure how or where to start, add debug breakpoints or puts statements in the code. This will help you understand the code workflow.
  4. Write down your understanding or have a Rubber duck conversation. (The…
Tender Lovemaking 

Fast Tokenizers with StringScanner

Lately I’ve been messing around with writing a GraphQL parser called TinyGQL. I wanted to see how fast I could make a GraphQL parser without writing any C extensions. I think I did pretty well, but I’ve learned some tricks for speeding up parsers and I want to share them.

Today we’re going to specifically look at the lexing part of parsing. Lexing is just breaking down an input string in to a series of tokens. It’s the parser’s job to interpret those tokens. My favorite tool for tokenizing documents in Ruby is StringScanner. Today we’re going to look at a few tricks for speeding up StringScanner based lexers. We’ll start with a very simple GraphQL lexer and apply a few tricks to speed it…

A very basic lexer

He…

Felipe Vogel 

Server-sent events

In my last post, I rewrote a little Rails app with Roda and Turbo Streams. In this post I’ll show how I solved the app’s last and biggest problem: slow API calls. So slow that the user had to wait several seconds between pressing the “Next article” button, and actually seeing a new article.

The app is called Wiki Stumble. Here’s the live site and the GitHub repo. The app shows summaries of Wikipedia articles personalized to the user’s likes and dislikes.

Due to Wikipedia APIs not having…

Hi, we're Arkency 

The most underused pattern in Ruby

The most underused pattern in Ruby

Recently one of the RailsEventStore users posted an issue that one wanted to use RES on a Postgres database with PostGIS extension. Migration generator used to setup tables for events and streams was failing with UnsupportedAdapter error.

In RailsEventStore we supported to date PostgreSQL, MySQL2 and SQLite adapters representing given database engines. But if you want to make use of mentioned PostGIS extension, you need install additional activerecord-postgis-adapter and set adapter: postgis in database.yml. Our code relied on value returned by:

ActiveRecord::Base.connection.adapter_name.downcase
=> "postgis"

I thought — Ok, that’s an easy fix, PostGIS

Drifting Ruby Screencasts 

System Tests

In this episode, we look at adding system tests in our application to test our Stimulus Controllers. We'll also look at how to DRY up some of the tests and how to run them in a headless environment.
Giant Robots Smashing Into Other Giant Robots 

A Peek Behind the Curtain of Our New Open Source Page

We recently launched a new open-source page. While this blog post gives a good overview of why we chose to highlight particular content, we also faced some interesting technical challenges while building it.

Querying contributions with GraphQL

screenshot of the thoughtbot open source page showing some of our most popular projects

A lot of what occurs in the open-source world happens on GitHub, and thoughtbot is no exception. All our repositories are hosted there, so this was a natural place to start. We also wanted to highlight our team’s contributions to other open source projects in the community.

GitHub has a GraphQL API that allows us to query for all the information we need with a single request. We used the graphql-client gem to query the GitHub API. This…

Akshay's Blog 

Let's Implement the Map Method from First Principles

This post originally started as an answer to this question on Reddit: When to use lambda or proc vs. regular functions. As with all my writing goes, it got so large that I had to convert it to a blog post.
Let's Implement the Map Method from First Principles

A higher order function is a function that

  • takes another function as a parameter,
  • returns a function, or
  • does both.

It's a very important and powerful concept in functional programming, and Ruby has a first-class support for higher-order functions, via its delicious flavors like blocks, procs, and lambdas.

Blocks, Procs, and Lambdas: A Beginner’s Guide to Closures and Anonymous Functions in Ruby
Closures and anonymous functions are very useful concepts, especially in functional programming.…
Tom Dalling 

Nugs And Negative Failure Demand

In this article I’m going to take a look at software quality as a way to differentiate between junior, mid-level, and senior software engineers, through the lens of failure demand, purely so that I can introduce a new concept that I thought up on a walk today, which I’m calling negative failure demand.

Notes to self 

Business Class 1.1 released with Paddle Billing, an improved CRUD generator, and new pricing

The Rails SaaS boilerplate Business Class goes 1.1. Here’s what’s new.

Paddle Billing

The release of Business Class had an unfortunate timing since Paddle just recently announced all new offering called Paddle Billing. But it didn’t stop me. I worked hard last month and rewrote all functionality of Paddle Classic to Billing for this version of Business Class. The whole integration is also based on latest version of Pay and comes with an even larger set of tests.

Business Class is therefore now the very first Rails template supporting Paddle Billing.

Improved generator

Business Class originally shipped with a revamped Rails scaffold generator with automatic team scoping, but the new…

Tender Lovemaking 

Fast Tokenizers with StringScanner

Lately I’ve been messing around with writing a GraphQL parser called TinyGQL. I wanted to see how fast I could make a GraphQL parser without writing any C extensions. I think I did pretty well, but I’ve learned some tricks for speeding up parsers and I want to share them.

Today we’re going to specifically look at the lexing part of parsing. Lexing is just breaking down an input string in to a series of tokens. It’s the parser’s job to interpret those tokens. My favorite tool for tokenizing documents in Ruby is StringScanner. Today we’re going to look at a few tricks for speeding up StringScanner based lexers. We’ll start with a very simple GraphQL lexer and apply a few tricks to speed it…

A very basic lexer

He…

RailsNotes — The Ruby on Rails guides you wished you had. 

Refactoring from feature specs to system specs

In this article, I break down the difference between system specs and feature specs in RSpec and Rails, and walk you through refactoring your feature specs to system specs.
Remote Ruby 

No Surprise | Now We Are A Burger Podcast

In this episode, Jason, Chris, and Andrew start us off with a conversation about burger toppings preferences, discussing whether certain ingredients should be included in “the works” and sharing tips to prevent burger slippage.  The discussion transitions to programming topics, exploring the challenges of working with multiline environment variables and the intricacies of Bash scripting. The guy’s dive into the benefits of building UI components using frameworks like Tailwind CSS and Alpine.js, emphasizing the importance of well-organized and specialized components for better code management. The conversation also touches on the desire for more pre-built component libraries in the…

GoRails Screencasts 

SQL Learning Path - Having Statements

In this lesson, we will look at how to filter the groups resulting from writing group by clauses with the HAVING clause.
GoRails Screencasts 

SQL Learning Path - Group By with Joins

In this lesson, we will look at how to use joins together with group by clauses to group by columns from other tables.
GoRails Screencasts 

SQL Learning Path - Group By Statement

In this lesson, we will look at how to group rows by a given column and then use aggregate functions to perform calculations on the results.
GoRails Screencasts 

SQL Learning Path - Join Statements

In this lesson, we will look at using the foreign keys to join tables together to return results from both tables.
GoRails Screencasts 

Sql Learning Path Foreign Keys

In this lesson, we will begin to explore how we can relate rows from one table to rows in another table by using foreign keys.
GoRails Screencasts 

SQL Learning Path - Primary Keys

In this lesson, we will look at how to setup auto-incrementing integers ids for our rows in our database tables.
GoRails Screencasts 

SQL Learning Path - Update Delete Statements

In this lesson, we will look at how to update the data and delete rows of data from our database tables.
GoRails Screencasts 

SQL Learning Path - Where Calculations

In this lesson, we will look at how to use calculations with the where clause to filter the results from our database queries.
GoRails Screencasts 

SQL Learning Path - Where Clause

In this lesson, we will look at how to filter the results from our database queries.
GoRails Screencasts 

SQL Learning Path - String Functions

In this lesson, we will look at how to manipulate string data returned from our queries.