Ruby's flexibility has always been both its greatest strength and its greatest weakness. You can write amazingly expressive programs. You can also slip and break them in amazingly expressive ways. RBS is a new type annotation system in Ruby 3 that seeks to keep ruby's flexibility while protecting us from some of its dangers. In this article, Julio Sampaio walks us through RBS. He explains the impact it has on metaprogramming, and he shows us how we can use it to make our own apps more robust.
One of the easiest ways to speed up your web app is to cache slow-to-compute data, so it doesn't have to be recomputed the next time the page loads. In this article, Keneth Ekandem shows us how to use Redis to cache DB results in a Laravel App.
Ruby lets you express yourself like few other languages, with a minimum of boilerplate. It's fantastic until it isn't. Until one day when you think you're calling the `foo` method you wrote last week, but instead, you end up calling a `foo` method that came with some gem from 2008. In these situations, knowing about Ruby's method lookup rules will save your bacon.
One of the best things about Rails is that it protects your app from a wide variety of injection attacks with minimal development effort. But we're never 100% safe. After all, Rails can't protect us from our own bad decisions. We need to understand the threats so we know when we can lean on Rails and when we can't. In this article, Diogo Souza introduces us to the OWASP Top 10 list of vulnerabilities and dives into injection vulnerabilities to show us how rails protects us against them and how we can protect ourselves.
As developers, our world is made of text, but computers only understand numbers. What gives? A process called character encoding maps numbers to letters. Easy enough, until you realize that we need to encode every character from every language while keeping file sizes small and staying compatible with legacy systems. In this article, José shows us everything we need to know about character encoding for PHP developers - including what to do when it breaks!
To decide on a front-end for your Rails app, you need a feel for the options. Does a certain JS framework speak to you or does it make you feel dirty inside? There's only one way to find out! In this article, Julio Sampaio walks us through creating an React app from scratch and integrating it with a Rails back-end via webpacker.
Let's face facts. Git is not fun. Git is not friendly. No. It's just infuriatingly useful, so we're stuck with it. But what if you could make git more friendly? More convenient? Would that make your day a little less stressful? In this article, Julie Kent shows us how we can do this with just a few simple tweaks.
There are lots of ways to sort data. Insertion sort is particularly interesting because it sorts the data in place and is pretty easy to understand. Of course, most of us just use the #sort method. But interviewers still love to ask questions about sorting algorithms and related topics like Big-O notation. In this post, you'll learn not only how insertion sort works but also how to implement it yourself in ruby.
If you've ever checked the environment in your Rails app with Rails.env.production? you've used a fascinating little utility class called StringInquirer. In this post, Jonathan Miles dives into the rails codebase to show us exactly how StringInquirer works and how we can bring a little of its magic to our own apps.
Before you can decide on a front-end for your Rails app, you need a feel for the options. Does a particular JS framework speak to you or does it make you feel dirty inside? There's only one way to find out! In this article, Julio Sampaio walks us through creating an Angular app from scratch and integrating it with a Rails back-end via webpacker.