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

github.com

FactoryBot allows a :class option to its factory definitions, to set the class to construct. However, this option is not...

After loading a staging dump into development, you might get an ActiveRecord::EnvironmentMismatchError when trying to replace the database (like...

If another session is accessing your database you are trying to reset or drop you might have seen the following...

docs.ruby-lang.org

Use return to return from a method. return accepts a value that will be the return value of the...

I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...

before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...

There are many approaches out there how you can import data from a legacy application to a new application. Here...

You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...

Native promises have no methods to inspect their state. You can use the promiseState function below to check whether a...

github.com

Use Traim to build a RESTful API for your ActiveRecord models with very little code. Traim assumes your API resources...

Sometimes you add Paperclip image styles, sometimes you remove some. In order to only keep the files you actually need...