Articles

A collection of my articles on technology, engineering, and products.

How to Access Production Data in Rails Migrations

Sooner or later every project will need to migrate production data, not only the schema. There are many different approaches in the wild – most of them overly complex. In this article we’ll tackle the problem using vanilla Rails.

Continue reading »


How to Protect Individual Resources with Passwords

User authentication in Rails is a solved problem but how can we protect individual resources with a password? It turns out that all we need is vanilla Rails and not that much code.

Continue reading »


How to Reduce Test Interference in Minitest

Global state can easily lead to interference between test cases and cause random failures. In this article, we’ll discuss a technique for alleviating this problem when reducing the global state is infeasible.

Continue reading »


Numbering Copies Using Enumerators

Copying a file in a file manager results in adding a copy counter to the file name. In this article, we’ll devise a simple and elegant algorithm based on Enumerator for doing the same in a Rails app.

Continue reading »


How to Reduce Memory Usage by Tuning Gemfile

Rails is known for many things but memory effectiveness is not one of them. By default, it loads all gems, used and unused, which contributes to the overall memory footprint. Fortunately, we can easily eliminate this waste without touching the app.

Continue reading »


The Architecture No One Needs

Single-page apps are all the rage nowadays. Many praise their vague technical benefits while ignoring tremendous development costs.

Continue reading »


How to Speed up Your Tests without Touching the Code

The larger the test suite the slower it gets. This is an obvious yet annying truth. In this article, I present a simple and generic technique for improving test suite performance (almost five-fold in my case) without touching the code base at all.

Continue reading »


You can follow me on Twitter for more ideas, tools, and discussions about software engineering.

Leave your email to receive updates about articles.