Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
wasabigeek's blog 

Visitor Pattern in Ruby: Examples from Rubocop

In this post, we’ll learn about the Visitor design pattern and it’s tradeoffs by looking at a real world example: Rubocop, a Ruby linting and formatting library.

What is the Visitor design pattern?

The visitor design pattern separates the operation to be performed from a complex object structure (e.g. a tree whose nodes have many types).

visitor.png

This makes it easier to introduce new operations (“visitors”) for the same structure, at the cost that changing the object structure requires all visitors to be changed. So this pattern works best when changes to the underlying structure are rare, and we expect many different operations to be introduced.

What is Rubocop?

Rubocop is a…

Kevin Newton 

AArch64 Bitmask Immediates

This post illustrates a small but fascinating piece of the AArch64 architecture called bitmask immediates. We’ll briefly cover what AArch64 is, how it is different from other architectures, what a bitmask immediate is, and how all of this can be encoded in Rust.

For context, I work at Shopify on YJIT, a just-in-time compiler for CRuby. Lately I’ve been working on adding support for the AArch64 architecture; practically this means support for Apple M1s. Learning the ARM architecture and encoding it has been quite an adventure; you can check out our working branch if you’d like to follow along.

Fixed-width instruction sets

First, a bit of background. AArch64 is a fixed-width instruction…

Ruby on Rails 

Bugfixes, improvements and more!

Hola, this is Greg bringing you the latest news from the Rails world!

Improve failure safety for RedisCacheStore#delete_multi This PR fixes the issue when Redis is down and Rails.cache.delete_multi is called. With this change this will be gracefully handled rather than raising an exception.

Ensure drop_enum is always reversible The recently introduced drop_enum method to drop PostgreSQL Enumerated Types was not reversible with the if_exists: true option, because create_enum could not accept options. Not an issue anymore, because this PR fixes it.

Fix EtagWithFlash when there is no Flash middleware available In API only Rails apps, the flash middleware is not available which can lead to…

Remote Ruby 

Rubygem Idea for Juniors, Modern Assets in Rails & George Jetson's Birthday

[00:07:35] Andrew shares a free gem idea for Juniors or people who’ve never built a gem before. 


[00:10:20] Jason brings up a previous episode with Konnor Rogers where they talked about migrating Podia off Webpacker, and the guys chat more about that.


[00:17:56] Jason was looking something up for JavaScript and he tells us he couldn’t get Google to give him any results that weren’t for jQuery, and Chris talks about the interesting idea that Rails could sort of simplify Webpack with Webpacker, which they’ve done with jQuery, Prototype, and Scriptaculous.


[00:20:35] We hear about why CoffeeScript was such a welcomed flavor of JavaScript.


[00:22:23] Chris tells us what you can do using…

Awesome Ruby Newsletter 

💎 Issue 325 - Faster Ruby: Thoughts from the Outside

AppFolio Engineering 

Lisa: A Deep Dive into the Inquiry Parser

In our previous blog post we introduced AppFolio AI Leasing Assistant, Lisa, giving a high-level overview of her capabilities and insight into the value she can offer. One of the key technical components which enables Lisa to perform so effectively is the Inquiry Parser.

What is Lisa’s Inquiry Parser?

The leasing conversation flow is often initiated by a prospective resident submitting an inquiry via an Internet Listing Service (ILS), such as Zillow, Apartments.com, or a private homepage for the property. The first component of Lisa to spring into action in response is the inquiry parser. We use it to extract information from inquiries, and process the data collected to facilitate a…

Shopify Engineering - Shopify Engineering 

When is JIT Faster Than A Compiler?

Ruby Weekly 

A playground for Active Record experiments

#​616 — August 11, 2022

Read on the Web 🇺🇦

☀️ If you don't receive Ruby Weekly next week (August 18), don't panic – we're taking a week off for summer vacation :-) We'll be back on August 25.
__
Peter Cooper, your editor.

Ruby Weekly

Faster Ruby: Thoughts from the Outside — Earlier this week, the author wrote an interesting retrospective on Ruby+OMR, a now-abandoned 2015 effort to boost Ruby’s performance via OMR, but has now moved on to thinking about how he’d approach making Ruby faster these days, taking some lessons from JavaScript. Hacker News ended up with a lengthy discussion on this topic, too.

Matthew…

Ruby Rogues 

Bidirectional Code Generation - RUBY 558

Imagine a tool that lets you write templates that can generate code, but also parse that code back into the initial variables.  Depending on how flexible your templates are, it can even parse code that has been modified by hand after generation.  Today on the show, the panel interviews Lucas Luitjes, creator of Monocle, the tool that allows for this kind of integration.

In this episode…

  1. What is bidirectional code generation
  2. Visual rails editor prototype
  3. How does the program work, step by step
  4. Parsing results from snippets
  5. Multi-node placeholders
  6. Utilizing the erb2builder library
  7. Ruby security features
Connect with Lucas via email:  lucas@snootysoftware.com

Sponsors

Honeybadger Developer Blog 

A Comprehensive Guide to Rails Internationalization (i18n)

Thanks to the Internet, our big Earth has suddenly become a small place, in the sense that your customers on the other side of the world are now as close to you as your next door neighbor. However, the solution to the problem of distance is not everything. We have become closer, but we continue to communicate in different languages.

In addition to language barriers, there is also a cultural implication. We understand the same things in different ways; we have different systems of measurement and understanding of time. For example, in China, people understand 02.03.2021 as March 2nd, while in the USA, it is February 3rd. Also, Rails is very conventional about the app structure unless we are…

RubyGems Blog 

3.3.20 Released

RubyGems 3.3.20 includes enhancements and bug fixes.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Enhancements:

  • Include backtrace with crashes by default. Pull request #5811 by deivid-rodriguez
  • Don’t create broken symlinks when a gem includes them, but print a warning instead. Pull request #5801 by deivid-rodriguez
  • Warn (rather than crash) when setting nil specification versions. Pull request #5794 by deivid-rodriguez
  • Installs bundler 2.3.20 as a default gem.

## Bug fixes:

  • Always consider installed specs for resolution, even if prereleases. Pull request #5821 by deivid-rodriguez
  • Fix ge…
Saeloun Blog 

Infinite Auto Scroll using Turbo only ( No Stimulus / No Javascript )

In this article, we will create a Rails 7 Application and implement Infininte Auto Scroll. The scroll will be done using Hotwire Turbo only, and not a single line of Javascript will be used.

The App will display ten posts by default and on reaching the end of the page, more posts in batches of ten will be introduced further until there are no more posts.

Create a Rails 7 Application

We get started by creating a Rails 7 Application.

rails _7.0.3_ new infinite-scroll-turbo

Add a Model

We are adding a simple model with only a body attribute, to keep things simple.

rails g scaffold Post body:text
rails db:migrate

Set the Posts page as the Home Page

Change the default root to Po…

The Ruby on Rails Podcast 

Episode 430: Dearly Departed (Brittany + Jemma)

After congratulating Jemma on her talk acceptance to RubyKaigi, the duo discuss how to handle when a co-worker is departing. From handling communication to acknowledging the importance of the departing, it's a topic that should resonate with many developers. They wrap up exclaiming over first #rubyfriend.

Show Notes & Links:

Sponsored By:

Scout APM

Try their error monitoring and APM free for 14-days, no credit card needed! And as an added bonus for Ruby on Rails listeners: Scout will donate $5 to the open-source project of your choice when you deploy. Learn more at http://scout…

Ruby Magic by AppSignal 

A Deep Dive into Memory Leaks in Ruby

In the first part of this two-part series on memory leaks, we looked at how Ruby manages memory and how Garbage Collection (GC) works.

You might be able to afford powerful machines with more memory, and your app might restart often enough that your users don't notice, but memory usage matters.

Allocation and Garbage Collection aren't free. If you have a leak, you spend more and more time on Garbage Collection instead of doing what you built your app to do.

In this post, we'll look deeper into the tools you can use to discover and diagnose a memory leak.

Let's continue!

Finding Leaks in Ruby

Detecting a leak is simple enough. You can use GC, ObjectSpace, and the RSS graphs in your APM tool…

RubyGems Blog 

July 2022 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 July.

RubyGems News

This month in RubyGems, we released new versions of RubyGems 3.3.18, 3.3.19 and Bundler 2.3.18, 2.3.19.

The following is a non-exhaustive list of other improvements included in the above releases (see the changelog for further information):

  • updated the CLI to display MFA warnings on gem signin, to support work done on the RubyGems.org side - #5590.
  • added the long-requested feature of allowing to gem install from specific groups only - #5579.
Gusto Engineering - Medium 

Finding the Less-Risky Path Together: Security Partnership at Gusto

Four people standing on a rocky mountain topped with snow, more rocky peaks and the sunset in the backgroundMountain climbing and software development: with some precautions, both can be safe. Image source

Security work can often be divided into two parts: people and computers. The relatively new role of security partner is ideal for those who like both, as it involves working to meet the company’s needs for a secure system and needs of engineers to have a reasonable technical solution to execute and maintain. Does it sound complicated? It is! But that’s what makes it satisfying and why the security partner role has become more common across tech companies.

Gusto’s Security Partners team sits within Product Security, and we’re far from the only company that’s recognized the need for this role.…

Martian Chronicles, Evil Martians’ team blog 

Taking off the Heroku training wheels: the Rails preflight checklist

Authors: Vladimir Dementyev, Principal Backend Engineer at Evil Martians and Travis Turner, Tech Editor at Evil Martians

You’ll hardly find a Ruby on Rails developer who has never tried to deploy their applications via Heroku, a cloud-based platform which innovated how we deliver code from development to production. The git push heroku main flow is pure magic, but in order for it to work, you need to tweak your application a little bit. Today, I’d like to share my checklist targeted to small teams going live with Heroku.

At the time of this writing, in mid-2022, plenty of alternatives to Heroku are available, but it’s still the number one choice for shipping your first Rails MVP.…

Shopify Engineering - Shopify Engineering 

Six Tips for Staying Technical as a CTO

Here's what’s on my mind as a technical leader: How do I gain the credibility of the smart people on my team who are far more technical and detailed than I am, in order to lead them?

More

Saeloun Blog 

Ruby introduces Regexp.timeout

Regular expressions (regexps) are codes that demonstrates the contents of a string. They’re generally used to test a string’s patterns and determine which portions of the string are a match to the output desired.

  • Syntax: Regexp.=~()
  • Parameter: Regexp values
  • Return: true – if two expressions matches string, if there is no match, then it will return False.

They are usually built with the /pat/ and %r{pat} literals or the Regexp.new constructor.

A regexp is usually confined within forward slashes (/). For example:

/par/ =~ 'parrot'   #=> 0
/p/.match('parrot') #=> #<MatchData "p">

If a string has the pattern we are looking for, then it is said to be a match.

Here, the word,…

Closer to Code 

Karafka framework 2.0 announcement

I'm thrilled to announce the new and shiny Karafka 2.0. It is an effect of my work of almost four years.

For those who wonder what Karafka is, Karafka is a Ruby and Rails multi-threaded efficient Kafka processing framework.

Karafka 2.0 is a major rewrite that brings many new things to the table but removes specific concepts that were not as good as I initially thought when I created them.

In this announcement article, I will describe the most noticeable features and improvements that got into this release. If you are interested in a more comprehensive list, you can find it here.

Note: If you are looking for upgrade notes, they will be provided as a separate article.

Getting started

If you…

Test Double Blog 

Do more with less: get scrappy and creative

My career has been both lucky and unlucky. I’ve worked in a wide range of industries and companies, super big (17,000+) and small (less than 50). I also experienced economic downturns, digital disruption, mergers, acquisitions, layoffs, and a pandemic.

That’s a lot.

I sometimes wonder how that eighteen-year-old doing a marketing internship straight out of high school is actually the same person I am now.

Disruptive forces put teams in a tough place. When you work in marketing, you collaborate with teams across all functional areas. So you see the impact of things like layoffs and industry-wide disruption.

When disruption hits your organization, and especially when it hits your team … well,…

The Bike Shed 

349: Unpopular Opinions

Steph and Chris announce Joël Quenneville as the new host of the show! 🎉 Joël talks about his grand plans for where The Bike Shed is going to go from here. (Okay, maybe not grand plans...!)

Together, the group chats about unpopular opinions and hot programming takes.


This episode is brought to you by Airbrake. Visit Frictionless error monitoring and performance insight for your app stack.


Follow Joël on Twitter! Welcome him to the show.
Joël Quenneville - DRY is harmful for intermediate devs


Become a Sponsor of The Bike Shed!

Transcript

CHRIS: Thank you. No brown M&M'S. No asking me weird questions. I ask very little.

STEPH: Hello and welcome to another episode of…

Benito Serna 

Active Record Playground Runner Introduction

Have you ever wanted to just create an active record example to someone in your team without thinking in the database setup?

Or maybe send two different models designs with some examples to see the difference, but the setup what just to difficult?

Or like me, create a bunch of examples to teach an Active Record concept?

If you have had one of this problems, maybe this tool can help you.

A tool to run Active Record examples

I want to introduce a new tool that I am working on.

It will help you play with Active Record and Postgres, without the thinking in the database setup.

You will be able to declare the schema, models, seeds and examples in just one file, like this:

schema do
  creat…
code.dblock.org | tech blog 

Managing GitHub Notifications in GMail

My e-mail inbox is flooded with GitHub notifications, just like yours.

Having tried half a dozen ways to get a queue of notifications, I settled on creating a filter and use it to label the email, and remove it from the inbox, the first time I receive a new notification for a repo I am subscribed to on GitHub.

Then I check those emails in bulk and never miss anything.

Click here for the original tweet-sized version of the above.

Managing GitHub Notifications in GMail was originally published by Daniel Doubrovkine at code.dblock.org | tech blog on August 08, 2022.

Hanami Mastery newest episodes! 

#26 Generate Sitemaps for Hanami applications!

Sitemap is one of the core features for any web application, to make sure your site is indexed properly. Here is how to generate sitemaps in Hanami applications using sitemap_generator gem!
Test Double Blog 

Double Up with Test Double at ElixirConf 2022

Even though Test Double has been 100% remote from the start over 10 years ago, we always appreciate the opportunity to gather in communities at conferences. One of our values is Always Improving, so our Double Agents enjoy stretching themselves to grow by staying on top of what’s new at conferences, and sharing what we learn along the way. That’s been challenging the past couple of years, and we’re excited to be back.

Double Agents will be attending ElixirConf in-person and virtually this year, and what better way to mark this than helping solve problems? As part of an ElixirConf sponsorship, Test Double is offering several activities for the Elixir community. If you’re attending (in-person…

Ruby in Better Programming on Medium 

Building Responsive Rails Apps With Hotwire

In this article we’ll go through the basics of Hotwire, as well as build a sample app using Hotwire and Ruby on Rails

If you’re developing modern single-page applications with Ruby on Rails, you’re most likely using some fancy JS framework for your UI to be updated nicely, without page reloads. And there is really not much you can do without using them, that’s kind of a standard these days… until Rails got Hotwire.

With Hotwire you can get fast and responsive web applications, but without writing a ton of JavaScript. Well, sounds great, but what is Hotwire?

In this article, we’ll go through the basics of Hotwire, as well as build a sample app using it.

What options are there for responsive…

Drifting Ruby Screencasts 

Ubuntu Desktop

Ubuntu is an open source software operating system that offers a great development experience and can run on most x86/amd64 systems. In this episode, we set up our Ruby on Rails development environment on Ubuntu 22.04 LTS Jammy Jellyfish.
Honeybadger Developer Blog 

Building a Laravel App with TDD

In this tutorial, I’ll show you how to get started with test-driven development in Laravel by creating a project from scratch. After following this tutorial, you should be able to apply test-driven development in any future Laravel projects. Additionally, the concepts you will learn in this tutorial should also be applicable to other programming languages.

We’ll create a food ordering app at its most basic level. It will only have the following features:

  • Search for food
  • Add food to cart
  • Submit order (Note that this won’t include the processing of payments. Its only purpose is saving order information in the database.)

Prerequisites

  • PHP development environment (including PHP and…
Ruby on Rails 

Strict template locals, detecting unused routes and an improved find_or_create_by

Hi, Petrik here with some updates on activities in Rails and associated projects over the last week.

Allow templates to set strict locals

By default, templates will accept any locals as keyword arguments. To define what locals a template accepts, add a locals magic comment:

<%# locals: (message:) -%>
<%= message %>

Try to find a second time if find_or_create_by hits a uniqueness constraint For the case where most of the time the record is expected to exist, find_or_create_by can be made race-condition free by re-trying the find if the create failed with ActiveRecord::RecordNotUnique. This assumes that the table has the proper uniqueness constraints, if not, find_or_create_by will still…

Add support for if_exists option when removing a check constraint 

The remove_check_constraint method now accepts an

Remote Ruby 

Gem Mining & Advice on Mentoring Developers

[00:02:46] Andrew tells us about being on the Rubber Duck Dev Show livestream with Collin Jilbert. 


[00:05:14] Have you ever used Alfred? Andrew fills us in on the app and Raycast. 


[00:12:15] Chris explains the “gem mining” he’s been doing.


[00:16:38] Andrew and Chris chat about using SQLite.


[00:20:41] Andrew asks Chris if he ever thinks how much extra code it is to have to support all these different things. Chris explains why he doesn’t think it be a whole lot. 


[00:23:20] We find out when Chris is evaluating these types of decisions, if he ever tries to write performance tests, benchmarks, or something to evaluate those assumptions and he explains how he thinks about performance in…

OmbuLabs Blog 

Every contribution counts, no matter how small

Hello everyone, this is my first blog post on the ombulabs.com blog. I am so excited to have joined the company and to have the opportunity to write here.

I have chosen this topic because I've felt like nobody tells you how or where to start contributing. This is a problem in the first few years when entering the university or when you want to learn by yourself.

What I'd really like to highlight is to keep going.

No matter what you do, if your contribution is long or short,

in the end, the interesting thing is that you are contributing.

That being said, I’d like to mention a quick checklist to fill for helping you to find your path in the tech environment.

✔️ Find something…

The Rails Tech Debt Blog 

Naming Things is Hard

In the developers’ world, there is a well known quote by Phil Karlton that goes There are only two hard things in Computer Science: cache invalidation and naming things. We usually think about that phrase in the sense that it’s hard to come up with a clear, descriptive, and concise name for the code we write (variables, methods/functions, modules/classes, etc), but sometimes, the perfect name we found can be a problem too.

With Great Power Comes Great Responsibility

Ruby allows us to do many things that could be difficult in other languages, we can modify classes and override methods on the fly, we can define new classes programmatically based on the result of other code, we can…

Awesome Ruby Newsletter 

💎 Issue 324 - Scaling Sidekiq at Gusto

Shopify Engineering - Shopify Engineering 

Spin Cycle: Shopify’s SFN Team Overcomes a Cloud-Development Spiral

AkitaOnRails.com 

[Akitando] #124 - Como Funciona Sockets, Cliente, Servidor e a Web? | Introdução a Redes Parte 4

Agora que todo mudno sabe como funciona o básico de rede, vamos ver como funciona o básico de aplicações de rede, o que são sockets, pra que eles servem, como disso chegamos em protocolos como HTTP ou FTP e os vários detalhezinhos que complicam a cabeça de um iniciante em programação Web.

Conteúdo

  • 00:00 - Intro
  • 01:36 - Noção de Sockets
  • 02:26 - Entendendo Comunicação Entre Processos
  • 03:18 - Memória Protegida/Isolada Impede Comunicação
  • 05:30 - Comunicação via Pipes
  • 07:18 - Comunicação via Arquivos
  • 09:56 - BSD Sockets
  • 12:43 - Fluxo de conexão
  • 16:54 - Portas
  • 19:55 - Recapitulando navegador/DNS
  • 21:15 - Exemplo de server web com Node
  • 22:17 - localhost é diferente de 0.0.0.0
  • 23:43 -…

SCRIPT

Olá pessoal, Fabio Akita

No começo dessa mini-série eu ia só até o…

Ruby Weekly 

Scaling Sidekiq with gusto

#​615 — August 4, 2022

Read on the Web 🇺🇦

Ruby Weekly

Scaling Sidekiq at Gusto — The popular background job processing system is almost everywhere these days, so you might find it useful to learn how one team at a large payroll service went about cutting costs and reducing latency.

Kelly Sutton

The Four Stages of Testing That Help Your Focus — The esteemed author of numerous Ruby and Rails books reflects on a way to simplify your thinking around tests – they’re either in one of three failure stages, or they work (but even then you need to think about how that became the case!)

David Bryant Copeland

naildrivin5.com - David Bryant Copeland's Website 

The Four Stages of Testing That Help Your Focus

When writing tests, it’s useful to consider that the tests are always in one of four distinct stages, and knowing which stage they are in can direct your next steps. This can make testing a bit less painful than it might otherwise be.

The four stages are:

  1. The code doesn’t compile/build/parse
  2. The tests produce an error (as opposed to a failure)
  3. The tests are failing
  4. The tests are passing

Working effectively with tests requires understanding the difference in these stages and being super careful to take only certain actions depending on what stage you are in.

When tests aren’t passing, it can be extremely frustrating trying to figure out exactly why and what to do about…

Honeybadger Developer Blog 

Logging in Python

When an application runs, it performs a tremendous number of tasks. A simple to-do app can have tons of tasks like - user logins, creating to-dos, updating to-dos, deleting to-dos, and duplicating to-dos. These tasks can result in success or may end up with some errors. Hence, there is a need to monitor events happening and analyze them to identify bottlenecks in the performance of the application. This is where logging is useful.

In this article, you'll learn how to create logs in a Python application using the Python logging module. Logging can help Python developers of all experience levels develop and analyze an application's performance more quickly.

What is Logging?

Logging is the…

Gusto Engineering - Medium 

Payroll Industry Needs Efficient Integration with Government

Post on the behalf of — Shelly Abril, Badri Sridharan, Praveen Awasthy

Nearly three million U.S. employers, representing more than 48% of the private sector workforce, use a payroll service provider (PSP) to calculate, pay and file employment tax returns. The largest payroll companies in the US deposited over 45% of all IRS employment taxes collected in 2016. PSPs often assist their clients in resolving problems or errors with their payroll tax filings and payments.

PSP clients are often small business owners that are not experts in employment taxes. PSPs collect information from their clients in order to generate their payroll tax filings and payments; this information is unique to the…

Ruby Rogues 

Vendor and Infrastructure Lock-In - RUBY 557

Vendor lock-in refers to a situation whereby the cost of switching to a different vendor or platform is so high that you are essentially stuck with the original platform.  Today on the show, Charles and Dave share personal stories of how they were forced to continue using a specific platform and what they did to rectify the various scenarios, plus they provide their insights on workaround strategies and how to prevent this from happening in the first place.


In this episode…


  • Designing your API to be more agnostic to the vendor
  • Changing environment variables
  • Creating a rails applications with variables in mind
  • How to avoid doing things manually vs. the risk of staying with the…
The Ruby on Rails Podcast 

Episode 429: Rubber Duck Dev Show with Chris Booth and Creston Jamison

Brittany guested on the Rubber Duck Dev Show, a livestream with two Rubyists (Chris & Creston) who chat live about all the aspects of development. They talk over the origins of how Brittany became the host of The Ruby on Rails Podcast and their thoughts and struggles on project management.

Show Notes & Links:

Sponsored By:

Honeybadger

Honeybadger makes you a DevOps hero by combining error monitoring, uptime monitoring and check-in monitoring into a single, easy to use platform. Go to Honeybadger.io and discover how Starr, Josh, and Ben created a 100% bootstrapped monitoring solution.

AppSignal

Monitor your apps from A to Z:…

Ruby Magic by AppSignal 

Connect a Ruby on Rails App with React in a Monolith

More and more people are using Ruby on Rails to create a back-end API application for a front-end app.

But what if you want to create a rich and functional interface with JavaScript and use Rails for the back-end, without having them in separate repositories? You can create a monolithic Rails application.

This article will show you how to connect a Rails application with a front-end developed in React (without splitting the code into two separate applications). We'll also give some alternatives if React is not your framework of choice, but you like the idea of a monolithic app with a rich front-end.

But first, let’s start with an architecture overview to see why linking Rails and React is…

Shopify Engineering - Shopify Engineering 

Mastering React’s Stable Values

The concept of stable value is a distinctly React term, and especially relevant since the introduction of Functional ComponentsIt refers to values (usually coming from a hook) that have the same value across multiple renders. And they’re immediately confusing. In this post, Colin Gray, Principal Developer at Shopify, walks through some cases where they really matter and how to make sense of them.

More

Martian Chronicles, Evil Martians’ team blog 

Phone inputs and you: the designer's essential UI guide

Authors: Gleb Stroganov, Product Designer at Evil Martians and Travis Turner, Tech Editor at Evil Martians

Telephone number inputs are a pretty common UI feature for tons of websites and applications. Seems simple enough to implement, right? Well, actually we need to account for a lot of different factors: What format will users input the number? Will we support international numbers? In this article, we’ll explore some background information, leaving no stone unturned, to help us effectively make these decisions, and we’ll share practical UI design tips.

With any input, the form of data we ultimately expect to receive is an important consideration. But, since this is a phone number…

BigBinary Blog 

Rails 7.1 adds callbacks for Action Cable commands at the connection level

Action Cable allows us to add callbacks for individual channels. These are:after_subscribe, after_unsubscribe, before_subscribe,before_unsubscribe, on_subscribe, on_unsubscribe. These callbacks areregistered individually for each Channel. Before Rails 7.1, there was no way inwhich we could register callbacks to be called before every command generically.Rails 7.1 solves this problem by providing a set of callbacks which can beregistered at the connection level. And these callbacks are called for everycommand regardless of which channel's command is being invoked.

These are the following callbacks which can be registered:

  1. before_command: This callback is invoked before any command can…
Blog 

Ruby on Rails Bootcamp - Key Takeaways From Participants

In 2022 we are holding our third Rubycamp. It’s a unique bootcamp dedicated to Ruby on Rails where, for two months, participants immerse themselves in Ruby with hands-on mentoring by experts.

The Bike Shed 

348: Breaking News

Steph and Chris share some big news about the future of The Bike Shed.

Steph shares an update about integrating with Knapsack Pro. Chris is excited for larger projects that will begin in the next few weeks. They answer a listener's question on keeping backlogs connected to the product vision.


This episode is brought to you by Airbrake. Visit Frictionless error monitoring and performance insight for your app stack.


Linear
RailsConf 2022 YouTube Playlist


Become a Sponsor of The Bike Shed!

Transcript:

CHRIS: We don't need Skype anymore. We live in a post-Skype world, audio flapjacks.

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

Test Double Blog 

Preparing for Extended Leave

At the time of writing this, I am a mere few days away from starting the second extended leave of my career. While mine have been parental leaves, there are other reasons you might be taking an extended break, including recovery from illness and sabbaticals based on years of service. Whatever the reason, if you have the advantage of time before the leave starts, there are a few things you can do to make the transition easier for your team and yourself.

I’ll freely admit that I didn’t do all of these things before my first leave, and it definitely caused problems for those left behind (and me when I returned). So, with all those lessons learned, here is what I’ve been doing this time to not…

Gusto Engineering - Medium 

Scaling Sidekiq at Gusto

Queues may lead to bottlenecks, both for sheep and background jobs.

Over the past year at Gusto, we’ve drastically changed how we approach Sidekiq in our main Rails monolith.

Our changes have reduced costs, reduced the number of outages, made it simpler for product engineers to use Sidekiq, and improved the customer experience.

This blog post will go through the different aspects of our Sidekiq transformation at Gusto.

What is Sidekiq?

Sidekiq is a background job queueing system written in Ruby that uses Redis for storage. It can be useful for sending emails, generating reports, or doing something that is generally too slow to handle in a web request. According to the 2022 Rails Hosting survey,…

Honeybadger Developer Blog 

Consuming APIs in Laravel with Guzzle

Guzzle is a PHP HTTP client that Laravel uses to send outgoing HTTP requests to communicate with external services. Guzzle's wrapper in Laravel focuses on the most popular use cases while providing a great development experience. Using Guzzle will save you time and reduce the number of lines of code in your application, making it more readable.

A common use case is when two Laravel applications are developed, and one functions as the server while the other is the client. They will need to make requests to each other. Here are a few things we'll cover in this article:

  • What is an API?
  • Difference between external and internal APIs.
  • What is Guzzle?
  • Laravel's HTTP Client.
  • Making requests.
  • Ins…

Prerequisites

The following will help you keep up with this tutorial:

Mike Perham 

Sidekiq and Request-Specific Context

At some point in growing a large-scale software system, you’ll require “out of band” context: data which is not explicitly passed as an argument to a function but rather implicitly attached to the request, job or event being processed. Usually context is implemented as thread-local variables; your code first sets up the necessary context and then processes the request. A common example is multi-tenancy: you might want to limit any data queried by a given request to a database schema specific to a given tenant.
Ruby on Rails 

Cache invalidation via ActiveStorage::Blob, Conditionally executing has_secure_password, etc

Maadwo! Emmanuel with some updates on activities in Rails over the last week.

Allow passing Hash on secure password validations You can now pass an option hash to has_secure_password. If the option evaluates to true, then has_secure_password executes along with validations, otherwise it doesn’t. 

Touch model records after ActiveStorage::Blob is analyzed Models directly associated to an ActiveStorage::Blob will now be touched if the blob in question is re-analysed, invalidating a model’s cache and fixing a race condition where a record can be requested and have a cache entry built.

Generate master.key even when require_master_key Previously, if config.require_master_key was set to true in …

Code with Jason 

The difference between procs and lambdas in Ruby

Note: before starting this post, I recommend reading my other posts about procs and closures for background.

Overview

What’s the difference between a proc and a lambda?

Lambdas actually are procs. Lambdas are just a special kind of proc and they behave a little bit differently from regular procs. In this post we’ll discuss the two main ways in which lambdas differ from regular procs:

  1. The return keyword behaves differently
  2. Arguments are handled differently

Let’s take a look at each one of these differences in more detail.

The behavior of “return”

In lambdas, return means “exit from this lambda”. In regular procs, return means “exit from embracing method”.

Below is an example, pulled…

Saeloun Blog 

Understanding the difference between React useEffect and useLayoutEffect hooks

Confused over useEffect hook and useLayoutEffect hooks?

In this article, we will look into how useEffect and useLayoutEffect differ from each other and their use-cases.

Before we dive into the difference between the two it is worth mentioning that both the hooks -

  • Handle side-effects in React
  • Have an identical signature

Let’s consider a simple example of a counter.

import { useEffect, useState, useLayoutEffect } from 'react';

function App() {
 const [count, setCount] = useState(0);
  useEffect(() => {
    console.log('useEffect is fired');
    //Side effect
  }, [count]);

return(
 <div>
    <h1>Count: {count} </h1>
    <button onClick={() => setCount(count + 1)}>Increment count

When the component is mounted Count: {count} appears on the screen. When the button is clicked the counter is incremented.

The same behavior is seen when useLayoutEffect is replaced with useEffect.

How is useEffect different from useLa…

Remote Ruby 

Junior Devs, Mentoring, and Training with Adam Cuppy

[00:06:03] Adam gives us a brief intro and we find out about the talk he gave at RubyConf 2015 called, What If Shakespeare Wrote Ruby.


[00:09:33] We hear Adam’s background, his journey to programming, and Co-founding Zeal.


[00:14:21] Adam fills us in on where he learned Rails, and the resources he used for learning Ruby on Rails.


[00:24:52] We learn what triggers Andrew about everybody saying there’s Rails jobs but they’re all looking for Seniors, and then we find out what Adam is doing to get more involved with teaching developers and helping level up developers.


[00:34:01] Andrew and Jason share their positive mentorship experiences and what they gained from them.


[00:41:06] Adam…

Awesome Ruby Newsletter 

💎 Issue 323 - Modernizing Einhorn

Shopify Engineering - Shopify Engineering 

10 Tips for Building Resilient Payment Systems

Julia Evans 

A toy remote login server

Hello! The other day we talked about what happened when you press a key in your terminal.

As a followup, I thought it might be fun to implement a program that’s like a tiny ssh server, but without the security. You can find it on github here, and I’ll explain how it works in this blog post.

the goal: “ssh” to a remote computer

Our goal is to be able to login to a remote computer and run commands, like you do with SSH or telnet.

The biggest difference between this program and SSH is that there’s literally no security (not even a password) – anyone who can make a TCP connection to the server can get a shell and run commands.

Obviously this is not a useful program in real life, but our…

Ruby Weekly 

RuboCop picks up the pace.

#​614 — July 28, 2022

Read on the Web 🇺🇦

Ruby Weekly

Tracing Ruby’s (Global) VM Lock — A new instrumentation API in Ruby 3.2 (due out in December) exposes GVL events so you can see what your app’s threads are up to. The two (runnable) examples in this post have us giddy to the possibilities.

Ivo Anjo

RuboCop Serves (Much) Faster — If you use RuboCop and you automatically run it on file changes, this news about a new, faster ‘server mode’ might make your day, and you can use the extra seconds spared to bake a cake to celebrate.

Bozhidar Batsov

Debug Ruby Apps in Production Without Stopping Them

Saeloun Blog 

Understanding the difference between React useEffect and useLayoutEffect hooks

Confused over useEffect hook and useLayoutEffect hooks?

In this article, we will look into how useEffect and useLayoutEffect differ from each other and their use-cases.

Before we dive into the difference between the two it is worth mentioning that both the hooks -

  • Handle side-effects in React
  • Have an identical signature

Let’s consider a simple example of a counter.

import { useEffect, useState, useLayoutEffect } from 'react';

function App() {
 const [count, setCount] = useState(0);
  useEffect(() => {
    console.log('useEffect is fired');
    //Side effect
  }, [count]);

return(
 <div>
    <h1>Count: {count} </h1>
    <button onClick={() => setCount(count + 1)}>Increment count

When the component is mounted Count: {count} appears on the screen. When the button is clicked the counter is incremented.

The same behavior is seen when useLayoutEffect is replaced with useEffect.

How is useEffect different from useLa…

BigBinary Blog 

How to remove the white screen just before the splash screen in Android

In order to add a splash screen we'll use thereact-native-splash-screenpackage. While most of the job is done by following the installation steps,there are some additional steps we need to follow for android.

There's a concept known as the "preview window" in android which serves a basicpurpose of faking a fast launch of app when the app icon is clicked. Whilepreview window fakes fast launching, it shows an empty white screen until theapp has loaded. More info available inthisarticle.

The preview window can itself be disabled by adding the following line in theandroid/app/src/main/res/values/styles.xml file.

<item name="android:windowDisablePreview">true</item>

However disabling the preview…

RubyGems Blog 

3.3.19 Released

RubyGems 3.3.19 includes enhancements, bug fixes and documentation.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Enhancements:

  • Display mfa warnings on gem signin. Pull request #5590 by aellispierce
  • Require fileutils more lazily when installing gems. Pull request #5738 by deivid-rodriguez
  • Fix upgrading RubyGems with a customized Gem.default_dir. Pull request #5728 by deivid-rodriguez
  • Stop using /dev/null for silent ui for WASI platform. Pull request #5703 by kateinoigakukun
  • Unify loading Gem::Requirement. Pull request #5596 by deivid-rodriguez
  • Installs bundler 2.3.19 as a default gem.

##…

Ruby Rogues 

RAILS_ENV - Ruby 556

How do you manage your actual rails environment configurations?  When you create a new rails application, do you utilize the provided development, test, and production environments, or deviate?  Today on the show, Dave and Valentino share their best practices on how they manage their environment variables and workflows within their rails environments.

In this episode…


  • Staging environments
  • QA environments
  • Replicating data and sampling strategies
  • Local environment testing
  • Creating Ruby objects
  • Internal API and servers vs. cloud data apps


Sponsors


Picks

Honeybadger Developer Blog 

Minitest vs. RSpec in Rails

Rails is a framework that comes with nearly everything included, focusing on conventions over configurations. Minitest is one of these conventions. Minitest is small and fast, and it provides many assertions to make tests readable and clean.

However, many alternatives to Minitest are available. The most popular one is RSpec.

RSpec has the same goals as Minitest but focuses on readable specifications describing how the application is supposed to behave with a close match to English. Minitest purports that if you know Ruby well, it should be enough.

The RSpec project focuses on behavior-driven development (BDD) and specification writing. Tests not only verify your application code but also…

Martian Chronicles, Evil Martians’ team blog 

And they lived happily ever after… the M&A

Authors: Irina Nazarova, Evil Martians CEO and Travis Turner, Tech Editor at Evil Martians

Over the last few months, I started noticing something everywhere: startups merging or acquiring one another. Some are old clients, some are potential clients, some are companies where friends work. This article comprises the collection of advice I’ve wanted to share with them before they complete the deal to make “happily ever after” a higher chance of success.

The reasons for a merger and acquisition vary: to end a resource-draining competition, to gain access to valuable client contracts, to access lucrative technology or functionality, to extend the runway for a business, and so on. One thing…

Ruby Magic by AppSignal 

How to Track Down Memory Leaks in Ruby

A memory leak is an unintentional, uncontrolled, and unending increase in memory usage. No matter how small, eventually, a leak will cause your process to run out of memory and crash. Even if you periodically restart your app to avoid this crash (no judgment, I've done that!), you still suffer the performance implications of a memory leak.

In this post, the first of a two-part series on memory leaks, we'll start by looking at how Ruby manages memory, how Garbage Collection (GC) works, and how to find a leak.

In the second part, we'll take a deeper dive into tracking down leaks.

Let's get started!

Ruby Memory Management

Ruby objects are stored on the heap, and each object fills one slot on…

BigBinary Blog 

Rails 7.1 allows audio_tag and video_tag to receive Active Storage attachments

Rails 7.1 allows audio_tag and video_tag ActionView helpers to receiveActive Storage Attachments which implicitly unpacks the asset path to beincluded in the src attribute of the <audio></audio> and <video></video>tags.

Previously, the helper methods recieved only the asset path/url. To get theasset path of an Active Storage Attachment, we had to explicitly callpolymorphic_path on the attachment, which returned the desired asset path.

Before

audio_tag(polymorphic_path(user.audio_file))# => <audio src="/..."></audio>video_tag(polymorphic_path(user.video_file))# => <video src="/..."></video>

After

audio_tag(user.audio_file)# => <audio src="/..."></audio>video_tag(user.video_file)# => <video…
The Ruby on Rails Podcast 

Episode 428: From Developer to CEO with Irina Nazarova

Irina Nazarova is the CEO of Evil Martians, a consulting company known as authors of PostCSS, AnyCable, imgproxy, and many blog posts and tutorials. She and Brittany discuss both her developer and CEO origin stories, sustainable opensource, leading really talented developers and Google Apps Script.

Show Notes & Links:

Support Ukraine:

Sponsored By:

Scout APM

Try their error monitoring and APM free for 14-days, no credit card needed! And as an added bonus for Ruby on Rails…

Island94.org 

Hate and sarcasm

Two things I read recently were commentary on forcefully-weak communications.

The first, from a r/rails thread in which the poster wrote “I hate React as it’s not using MVC pattern and It’s not organised + I hate JS.” A response:

You mentioned that you’re looking for junior positions which implies that you’re relatively new to the industry and have limited programming experience. Despite this, it seems that you’ve developed a lot of strong opinions.

There’s nothing wrong with having strong opinions and some of the best engineers are very opinionated. However, one of the biggest things you learn as you gain more experience is that you don’t know what you don’t know and that while…

The Bike Shed 

347: Tracking Velocity

Chris talks about a small toy app he maintains on the side and working with a project called capybara_table. Steph is getting ready for maternity leave and wonders how you track velocity and know if you're working quickly enough?

They answer a listener's question about where to get started testing a legacy app.


This episode is brought to you by Airbrake. Visit Frictionless error monitoring and performance insight for your app stack.


jnicklas/capybara_table: Capybara selectors and matchers for working with HTML tables


Become a Sponsor of The Bike Shed!

Transcript:

CHRIS: Just gotta hold on. Fly this thing straight to the crash site.

STEPH: Hello and welcome to another…

Boring Rails: Skip the bullshit and ship fast |  

Galaxy brain CSS tricks with Hotwire and Rails

This post is part of Hotwire Summer: a new season of content on Boring Rails!

In Hotwire applications, you need to lean more on the fundamentals of CSS and HTML. If you’re like me, you probably learned just enough CSS to get by, but never reach for it first. But that’s changed recently and I wanted to share patterns I’ve picked up recently that improve my Rails apps.

Empty States and Turbo Streams

An extremely common pattern in Rails apps is rendering a collection of elements and if the collection is empty, render an empty state.

<div id="my_list" class="flex flex-col divide-y">
  <% if @list.size > 0 %>
    <%= render partial: "list_item", collection: @list %>
  <% else %>
    <p>

This works fine when rendering a typical page, but if you use…

Ruby in Better Programming on Medium 

Integrating Stripe Payment Gateway to Your Rails API

A hands-on guide on Stripe’s Charge API Integration

Hello, everyone! In this article, I will go through a Payment Gateway Integration in a Rails API using the Stripe API. This will be a single payment approach, like a purchase. I’ve written about a recurring payment approach before. You can check it out here.

Getting Started

Stripe APIs have amazing features for e-commerces and marketplaces. To make our developer’s life easier, they offer SDK for some programming languages, including Ruby.

We will start adding the Stripe SDK Gem to our Gemfile using the following code:

gem 'stripe'

Don’t forget to run bundle install in your terminal after that.

Now you will need to create a stripe initializer file…

Code with Jason 

157 - Seth Tucker, Developer at KNOWiNK

In this episode, Seth Tucker returns to discuss the Crystal programming language, developing a contextually-aware chatbot, developing for SEO, page loading time and ad spending. 

The RubyMine Blog : Intelligent Ruby and Rails IDE | The JetBrains Blog 

RubyMine 2022.2 Released

RubyMine 2022.2

Hi all,

RubyMine 2022.2 is now available! Below is a brief overview of the most notable features. For a detailed description of this update, please visit our What’s New page.

Support for Rails URLs

With RubyMine 2022.2 you can click links in server logs for View, Route, and other references to navigate to the corresponding files. You can now also find and navigate to the urls with Search Everywhere, autocomplete HTTP requests, and use the Endpoints tool window.

rails urls

YARD

Starting with v2022.2 RubyMine recognizes YARD macro extensions and provides general coding assistance for them.

yard macros

Various new features

The new version is also equipped with code insight for pattern-matched local variables, an…

BigBinary Blog 

Rails 7.1 returns the Active Storage attachment(s) after saving the attachment

Previously, saving an attachment to a record returned a boolean, indicatingwhether or not the attachment was saved to the record. This is not helpful sincewe have to dig into the record again to retrieve the attachment. Starting Rails7.1, saving an attachment to a record returns the saved attachment. We can nowconveniently use blob methods like #download, #url, #variant etc on theattachment without having to dig into the record again.

Before

# rails console>> @user = User.create!(name: "Josh")>> @user.avatar.attach(params[:avatar])=> true

After

# rails console>> @user = User.create!(name: "Josh")>> @user.avatar.attach(params[:avatar])=> #<ActiveStorage::Attached::One:0x00007f075e592380…
Saeloun Blog 

Rails 6 bulk insert records

There are cases when we want to insert records in bulk. For eg., we have a list of users in CSV and we want to import these users in our application.

Rails has methods like delete_all or update_all to delete and update bulk records respectively. A similar method to insert bulk records was missing.

Rails 6 added insert_all, insert_all! and upsert_all to ActiveRecord::Persistence, to solve the above issue.

Before Rails 6

Before Rails 6, a bulk insert was achieved -

users = []
10.times do |i|
  users << User.new(name: "user #{i}")
end
User.import users
  • Creating records one by one
10.times do |i|
  User.create!(name: "user #{i}")
end
  • Using…
Hanami Mastery newest episodes! 

#25 Branch for a next Launch - Simplecov!

Enchance your test coverage reports by mastering the Simplecov gem!
Test Double Blog 

Preparing for Extended Leave

At the time of writing this, I am a mere few days away from starting the second extended leave of my career. While mine have been parental leaves, there are other reasons you might be taking an extended break, including recovery from illness and sabbaticals based on years of service. Whatever the reason, if you have the advantage of time before the leave starts, there are a few things you can do to make the transition easier for your team and yourself.

I’ll freely admit that I didn’t do all of these things before my first leave, and it definitely caused problems for those left behind (and me when I returned). So, with all those lessons learned, here is what I’ve been doing this time to not…

Test Double Blog 

Double Agent Profile: Sukhraj Singh

Name: Sukhraj Singh
Designation: Agent 000130
Double Agent Role: Senior Software Consultant
Special Skills: Coffee Lover, Humble, Always learning, Software freak
Aliases: LinkedIn
Location: Surrey, BC
Favorite Emoji: 😎

What impact are you proudest of in your career?

Making connections and growing as an individual. We spend a lot of time with our colleagues, even more than we spend with our families. Therefore, I strongly believe in building relationships that eventually help you to make this society a better place. Secondly, I am pretty happy with my individual growth. Of course, there is always still more room for growth, but I always try to keep learning new things.…

Honeybadger Developer Blog 

Everything You Need to Know About JavaScript Import Maps

When ES modules was first introduced in ECMAScript 2015 as a way to standardize module systems in JavaScript, it was implemented by mandating the specification of a relative or absolute path in import statements.

import dayjs from "https://cdn.skypack.dev/dayjs@1.10.7"; // ES modules

console.log(dayjs("2019-01-25").format("YYYY-MM-DDTHH:mm:ssZ[Z]"));

This was slightly different from how modules worked in other common module systems, such as CommonJS, and when using a module bundler like webpack, where a simpler syntax was used:

const dayjs = require('dayjs') // CommonJS

import dayjs from 'dayjs'; // webpack

In these systems, the import specifier was mapped to a specific (and versioned)…

AkitaOnRails.com 

[Akitando] #123 - Como sua Internet Funciona | Introdução a Redes Parte 3

Vamos mais na prática como a internet da sua casa funciona. O que vem depois do modem. Como seu PC, seu celular, sua TV, conseguem se comunicar e acessar a internet? E se no ipv4 dizem que já acabou os possíveis endereços de IP, como continuamos usando internet sem migrar pro tal ipv6? Aliás, o que é ipv6? Vamos tirar essas coisas básicas do caminho.

Conteúdo:

  • 00:00 - Introdução
  • 00:47 - Tanenbaum
  • 01:43 - OSI Model
  • 04:39 - Configurando roteador
  • 06:22 - Endereço ipv4
  • 07:36 - Máscara de Rede
  • 09:23 - Telefones e ramais
  • 11:28 - NAT
  • 14:25 - ARP
  • 16:40 - Default Gateway
  • 17:56 - DHCP
  • 19:39 - Hubs e Switches
  • 21:58 - DNS
  • 26:30 - Pi-Hole (DoH)
  • 27:57 - Roteamento
  • 30:20 - CGNAT
  • 33:20 - IPv6
  • 40:23 -…

Links:

  • Computer Networks (5th Edition PDF) (https://www.mbit.edu.in/wp-content/uploads/2020/05/Computer-Networks-5th-Edition.pdf)
  • What is a DNS record? (https://www.cloudflare.com/learning/dns/dns-records/)
  • MAC spoofing (https://en.wikipedia.org/wiki/MAC_spoofing)
  • What is…

SCR…

AppFolio Engineering 

AppFolio’s AI Leasing Assistant, Lisa

Let’s delve into the past and think about the last time you tried to rent an apartment. Hopefully, this doesn’t trigger any painful memories…

  1. First, you went to one of the familiar listing sites — Apartments.com, Zillow, or maybe even Craigslist if you’re the type to live dangerously.

  2. You sent a message or made a phone call to the places that piqued your interest.

  3. You heard back from some of the inquiries, but from others - silence. You might have even ended up on the phone with a grumpy landlord who acted as if you were wasting their time, or with an intern who couldn’t provide you with an ounce of concrete information.

  4. Once you made a connection, you scheduled a showing to take a look at the…

On paper, the process of finding housing sounds simple and relatively straightforward. However, in practice, it’s often a convoluted process –  one that includes many hardships and unpredictability. In fact,…

Ruby Together News 

June 2022 Monthly Update

Hello! Welcome to the monthly update. During June, our work was supported by Zendesk, DigitalOcean, Stitch Fix, and many others.

ruby together news

In June, Ruby Together was supported by 32 different companies, including Ruby member Zendesk. 1 company joined as a new member.

On top of that, 1 new developer signed up as a member. In total, we were supported by 127 developer members. Thanks to all of our members for making everything that we do possible. <3

RubyGems news

This month in RubyGems, we released new versions of RubyGems 3.3.16, 3.3.17 and Bundler 2.3.16, 2.3.17.

The following is a non-exhaustive list of other improvements included in the above releases (see the changelog for…

Ruby on Rails 

Bugfixes, performance improvements and more!

Hi, this is Greg, bringing you the latest news from the Rails world.

Fix caching of missed translations Using Object.new for the default value of a missing translation caused the cache store to return a different object when being fetched from the cache. This PR changes the default to an integer, which resolves the problem.

Add endless range example to the Active Record Querying guide Beginless/endless ranges can be used to create less than/greater than conditions with Active Record, but that was an undocumented feature before this PR added it to the Rails Guides.

Prevent ActionDispatch::ServerTiming from overwriting existing header value This change fixes the issue of ActionDispatch::Se…

A…

Remote Ruby 

Joined by Konnor Rogers

Welcome to Remote Ruby and thanks for joining us!  We’ve been trying to have our guest on for a really long time, and that time is here folks!  Today, we're joined by Konnor Rogers, a Developer at Microsoft known for his knowledge of all things front-end. On this episode, we’ll hear Konnor’s journey from being an EMT, getting into tech, and Andrew introducing him to Snowpack. Konnor tells us more about a new JavaScript runtime called Bun, his go-to Vite Ruby, and using Import Maps as a start tool.  The guys have some deep conversations about ESBuild, Webpack, Webpacker, Web Components, and the new Lit Web Component. Also, there’s some great Web Components on GitHub that are…

RubySec 

CVE-2020-35305 (gollum): XSS via `filename` parameter to New Page dialog

Cross site scripting (XSS) in gollum 5.0 to 5.1.2 via the `filename` parameter to the 'New Page' dialog.
RubySec 

CVE-2022-31163 (tzinfo): TZInfo relative path traversal vulnerability allows loading of arbitrary files

# Impact ## Affected versions - 0.3.60 and earlier. - 1.0.0 to 1.2.9 when used with the Ruby data source (tzinfo-data). ## Vulnerability With the Ruby data source (the tzinfo-data gem for tzinfo version 1.0.0 and later and built-in to earlier versions), time zones are defined in Ruby files. There is one file per time zone. Time zone files are loaded with `require` on demand. In the affected versions, `TZInfo::Timezone.get` fails to validate time zone identifiers correctly, allowing a new line character within the identifier. With Ruby version 1.9.3 and later, `TZInfo::Timezone.get` can be made to load unintended files with `require`, executing them within the Ruby process. For example,…
Awesome Ruby Newsletter 

💎 Issue 322 - Why Ruby is More Readable than Python

avdi.codes 

SIGAVDI #96: Olbas Edition

Hello friends,

I have a summer cold courtesy of my children and I’m not sure if it is making me more depressed, or providing a distraction from the depression. Either way, I got that summertime sadness fo’ sho.


What’s new

An image that lives in my head courtesy of innumerable movies: an airplane (or sail board) in a crash dive, on a bet that the dive will kick-start the engines before it intersects the ground. That has been the first half of my year: betting I could realize my vision of Graceful.Dev before I ran out of funds. It was a close one, but as of this past birthday sale, I’d say engines are green and this plane is in flight. Thank you to everyone who participated…

There’s…

Shopify Engineering - Shopify Engineering 

Data-Centric Machine Learning: Building Shopify Inbox’s Message Classification Model

Ruby Weekly 

Mike Perham's Ruby gem renovation

#​613 — July 21, 2022

Read on the Web 🇺🇦

Ruby Weekly

Down The Caching‑Hole? Adventures in 'HTTP Caching and Faraday' Land — It’s never good when you enable caching and performance gets worse. These cases often lead to long, forensic investigations that expose a previously unknown nuance and this case is no exception. “Off with their headers!”

Kryukov & Turner (Evil Martians)

Modernizing Einhorn: A Gem for Managing Forked Processes — Somehow I’d never come across Einhorn till now, but it started life as a Stripe-built gem for managing multiple copies of long-lived processes and now Sidekiq’s Mike Perham…

Martian Chronicles, Evil Martians’ team blog 

Smartly contracted: UI design and frontend for Certora

Authors: Danil Shashkov, Frontend Developer and Gleb Stroganov, Product Designer at Evil Martians

Developer tools and their professional interfaces exist in a special world. Evil Martians recently encountered these rules in the blockchain world, and in the process, we had the chance to elevate a product that helps analyze smart contracts. Smart contract is a self-executing contract with the terms of the agreement between buyer and seller being directly written into lines of code. This is one of the most critical areas in the blockchain landscape since smart contracts are responsible for financial transactions.

Smart contracts testing

Certora is a series B blockchain startup. In 2022,…

Ruby Rogues 

Managing Files and Text in Rails with ActiveStorage and ActionText - Ruby 555

Today on the show, Charles shares about his current projects and inner workings related to managing files and text on his various podcast portals.  The panel discusses their history with legacy platforms, their personal tool preferences, and the pros and cons of ActiveStorage and ActionText.

In this episode…

  1. Paperclip, Attachment_Fu, CarrierWave, ConfiguringFog and other legacy tools
  2. FTP for file storage
  3. CDN support and preferences
  4. Digital ocean servers
  5. Trix compared to other rich text editors

Sponsors


Links


Picks
Julia Evans 

What happens when you press a key in your terminal?

I’ve been confused about what’s going on with terminals for a long time.

But this past week I was using xterm.js to display an interactive terminal in a browser and I finally thought to ask a pretty basic question: when you press a key on your keyboard in a terminal (like Delete, or Escape, or a), which bytes get sent?

As usual we’ll answer that question by doing some experiments and seeing what happens :)

remote terminals are very old technology

First, I want to say that displaying a terminal in the browser with xterm.js might seem like a New Thing, but it’s really not. In the 70s, computers were expensive. So many employees at an institution would share a single computer, and each…

Honeybadger Developer Blog 

Managing User Permissions in Django

All applications need some sort of check or permission that controls what each user can do and determine whether the user is authenticated. In this article, you will learn how to set up multiple user roles, as well as how user permissions can be set depending on the user role. Furthermore, I will illustrate how to use Django’s built-in Users and Groups to apply permissions to multiple users. While a lot of articles only cover user permissions and the default Django user permissions, I will take it a step further by building an application with different user roles and then set permissions based on the role of the user.

Prerequisites

To follow this article, the following are required:

  • Pr…
Shopify Engineering - Shopify Engineering 

5 Steps to Bounce Back from a Negative Performance Review

Ebun breaks down how she used a not-so-great performance review to set clear development goals for herself and increase alignment with her lead, ultimately leading to a successful next review.

More

The Ruby on Rails Podcast 

Episode 427: Nick is an Influencer (Brittany + Nick)

Nick is officially an influencer! After Nick accidentally launched a co-host of Rubyists learning Japanese (including Brittany!), the duo chat about learning styles and recommended podcasts. Oh, and upgrade your Rails applications, listeners!

Show Notes & Links:

Sponsored By:

Honeybadger

Honeybadger makes you a DevOps hero by combining error monitoring, uptime monitoring and check-in monitoring into a single, easy to use platform. Go to Honeybadger.io and discover how Starr, Josh, and Ben created a 100% bootstrapped monitoring…

AppSignal

Tom Dalling 

Context, Costs, and Benefits

When is “measure twice, cut once” bad advice?

One of my hobbies is complaining about the tendency of software developers to view choices as binary, moralistic decisions. Measuring twice is obviously correct, and anyone who doesn’t do it is an unprofessional, evil wood waster. Either that or double measurers are a bunch of know-nothing shysters selling snake oil for exorbitant consulting fees. This black-and-white thinking is a mental shortcut that many animals take, but sometimes it’s nice to apply a little more intellectual rigour than a Pomeranian.

I’d like us to think less in terms of right and wrong when it comes to technical decisions, and think more in terms of context, costs and be…

Hanami 

Announcing Hanami v2.0.0.beta1

Hello Hanami community! We’re thrilled to announce the release of Hanami 2.0.0.beta1!

App-centric revolution

With this release, we’ve revolutionized the Hanami app structure: the app/ directory is the primary home for your code, and slices are now optional.

“What's a slice?,” you may ask! Think of slices as distinct modules of your application. A typical case is to use slices to separate your business domains (e.g. billing, accounting, admin). For our earlier 2.0 alpha releases, slices were the only way to build Hanami apps, which presupposed you wanted a full modular monolith composed of multiple domains.

With this change, you can just as easily build…

Saeloun Blog 

Rails avoids queries when performing calculations on contradictory relation

Previously, relation calculations such as count would make a query even when passed a contradiction, contradiction relation means passing an empty array for eg:-

  User.where(id: []).count

It does not make sense to call a database for such contradictory relations.

Before

So, before Rails 7 was introduced, the database was called if the relation used for count, sum, average, minimum and maximum would be contradictory.

  => Product.where(title: []).count
  Product Count (4.7ms)  SELECT COUNT(*) FROM "products" WHERE 1=0
  => 0 


  => Product.where(title: []).sum(:price)
  Product Sum (17.5ms)  SELECT SUM("products"."price") FROM "products" WHERE 1=0
  => 0 


  => Product.where(titl…
Test Double Blog 

Getting off Big Tech: Proprietary cloud alternatives

Despite spending many years manually copying photo folders from hard drive to hard drive, I’ve gotten quite used to the convenience of accessing and making changes to my photos, calendars, and contacts on all devices. However, when I started to become frustrated with the amount of control I had slowly given big corporations over my life, (see The Future of Tech: Building sustainably with Open Source), I started looking for alternatives. After over a year of research, trying and using various Open Source services, it feels like a good time to share my current suite of services and walk through their pros and cons.

I chose to setup and maintain a home server to host these services, but many…

Ruby in Better Programming on Medium 

Create a Static Website With Middleman and Deloy It on AWS

Build and host low-cost landing pages

Code with Jason 

156 - Hotwire with Matt Swanson

On this week's episode, I'm joined once again by Matt Swanson for a wide-ranging conversation that touches on blog writing, Hotwire, Turbo Frames, plants, making mistakes in the physical realm, books and science fiction, historic firsts and the impacts of innovation, and Stack Overflow.

Hanami Mastery newest episodes! 

#24 7 Levels of test coverage

Do you measure your test coverage? Do you know that everything below 80% is irrelevant? Here I list 7 levels of test coverage, check out where you are!
Josh Software 

Server side sorting and pagination using react-query and react-bootstrap-table-next (best practice)

In this blog, I will cover server side sorting and pagination using react-query and react-bootstrap-table-next. Generally, I prefer to use useQuery to get the data from the server, React Query manages query caching based on query keys. Query keys can be as simple as a string, or as complex as an array of many strings and nested objects. … Continue reading Server side sorting and pagination using react-query and react-bootstrap-table-next (best practice)
The Bike Shed 

346: Occasional Biscuits

Natural disaster movies, anyone? It's what Steph's been into, and Chris has THOUGHTS on the drilling in Armageddon.

Additionally, a chat around RuboCop RSpec rules happens, and they answer a listener's question, "how do you get acquainted with a new code base?"


This episode is brought to you by BuildPulse. Start your 14-day free trial of BuildPulse today.



This episode is brought to you by Airbrake. Visit Frictionless error monitoring and performance insight for your app stack.


Become a Sponsor of The Bike Shed!

Transcript:

AD: Flaky tests take the joy out of programming. You push up some code, wait for the tests to run, and…

Planet Argon Blog 

How Many Meetings Are Too Many?

How Many Meetings Are Too Many?

It's easy for an entire day to feel lost when you open the calendar and have back-to-back remote meetings.

Continue Reading

AkitaOnRails.com 

[Akitando] #122 - Detecção e Correção de Erros | Introdução a Redes Parte 2

Apesar de ser Parte 2 da mini-série de redes, vou falar pouco sobre redes propriamente ditas e focar em um aspecto que tem a ver com mais coisas que só rede: detecção e correção de erros.

Já se fez essa pergunta? Dados são transmitidos como ondas eletromagnéticas por cabos de cobre ou sem fio. Bits são gravados magneticamente em mídias como HDs ou Blu-Rays. Como que nenhum bit nunca é gravado ou transmitido errado? E se é, como poderíamos saber se 1 único bit é entendido errado?

Mas não se preocupem, apesar de não ser diretamente "redes" é importante saber o episódio de hoje, mas no próximo episódio vou realmente mostrar mais de "redes".

Conteúdo

  • 00:00 - Intro
  • 01:20 - Recapitulando…
Notes to self 

gem-compare’s new contributors

gem-compare v1.2.0, new contributors, and 200+ GitHub starts.

My little RubyGems plugin got some new contributions. Read the v1.0 announcement to know what’s the gem about.

New files diff

$ gem compare devise-otp 0.3.0 0.4.0 --diff
Fetching devise-otp-0.3.0.gem
Fetching devise-otp-0.4.0.gem
Compared versions: ["0.3.0", "0.4.0"]
  DIFFERENT files:
    0.3.0->0.4.0:
      * Deleted:
            app/controllers/devise_otp/devise/credentials_controller.rb
            app/controllers/devise_otp/devise/tokens_controller.rb
           …