If you want to make a screenshot of a website that works well in print or on a high-DPI...

Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...

Enumerable#all? returns true for an empty collection. This totally makes sense but you have to think about it when...

makandra dev
fontawesome.com

Font Awesome version 5 changed some icon names, and introduces new prefixes fab, far, and fas. There is a JavaScript...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...

To check which elements an ActiveRecord relation contains use the contain_exactly matcher. describe User do let!(:admin) { create(:user...

This is a small example on how you can check if your Postgres index can be used by a specific...

This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...

blog.bigbinary.com

This error is raised because your old database does not have a configured environment yet, which Rails 5 enforces.

You should avoid using application models in your migrations. But how else could you create records in a migration?

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02...

makandra dev

Git has two kind of tags: annotated lightweight Annotated tags are stored as full objects in the Git database. They...

relishapp.com

In most projects I know, Cucumber test suite speed is not an issue. Of course, running 350 features takes its...

requestb.in

Requestb.in is a webservice that gives you a temporary URL you can use to test request. The page will automatically...

We're usually running Ubuntu LTS versions. Sometimes newer hardware requires packages from more recent Ubuntu releases that only come...

makandra dev

An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...

When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...

Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...

If you are using PDFKit / wkhtmltopdf, you might as well want to use custom fonts in your stylesheets. Usually this...

You need to set the :inverse_of option manually for relations that have an association to a polymorphic model. Otherwise...

RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...

Let's say you have a form that you render a few times but you would like to customize your...