It’s often taught in programming that duplication is to be avoided. But for some reason it’s often stated that duplication is more acceptable in test code than in application code. Why is this? We’ll explore this, but first, let’s examine the wrong answers. Incorrect reasons why duplication is more acceptable in tests “Duplication isn’t actually […]
Working with invoices, contracts, or just reading your favorite mystery thriller—whatever the case, PDF files are everywhere. Learn how to work with PDFs in Ruby.
We’ll explain and demo the browser Contact Picker API. Contact Picker features have been ubiquitous in native mobile apps for a long time. Browser adoption has finally picked up enough and it’s time to implement these features there, too.
Lots of developers choose between dockerizing their development setup or leaving it as is. There is also a viable hybrid approach in combining Docker Compose with native processes.
Step-by-step instructions on setting up the ideal Ruby on Rails developer environment using Docker, optimized for new devs onboarding onto the project.
Have you ever wanted to create a hash where you could access the values like methods on an object? The OrderedOptions class in Rails lets you do just that. This post shows you how. We'll also explore how Rails implements this feature using Ruby's metaprogramming features.
Caching might seem a perfect solution to speed up slow database queries. However, caching in Rails apps can be easily misused, leading to poor maintainability or even slower performance than without it. In this blog post, I'll discuss the common pitfalls of caching SQL queries in Rails apps. I'll also describe my toolkit for assessing the cacheability of database queries and techniques for reducing the cost of caching infrastructure.
This is a little reference of tools to help you detect n+1 queries on a rails app.
Bullet
Prosopite
n plus one control
strict loading
Rack mini profiler
Do you need an efficient algorithm that checks a date range overlapping with some denoted set of date ranges? This article explains how to solve this problem with a subtle approach.
What a flaky test is and why they’re hard to fix A flaky test is a test that passes sometimes and fails sometimes even though no code has changed. There are several causes of flaky tests. The commonality among all the causes is that they all involve some form of non-determinism: code that doesn’t always […]