We can use ActiveRecord's where to add conditions to a relation. But sometimes our condition is not on the...

makandra dev

Or: How to avoid and refactor spaghetti code Please note that I tried to keep the examples small. The effects...

This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to...

PostgreSQL and ActiveRecord have a good support for storing dynamic attributes (hashes) in columns of type JSONB. But sometimes you...

medium.com

Root Insurance runs their application as a monolithic Rails application – but they've modularized it inside its repository. Here is...

pganalyze.com

It's every developer's nightmare: SQL queries that get large and unwieldy. This can happen fairly quickly with the...

aws ec2 describe-instances --output text --query 'Reservations[].Instances[?!not_null(Tags[?Key == `aws:autoscaling:groupName`].Value)] | [].[InstanceId]' | xargs -L1...

You can use the Youtube API to get data from youtube. Here are some resources and some things that are...

postgresql.org

There is an issue with when restoring a PostgreSQL dump created with pg_dump < v11 with pg_restore > v10:

As an application exists, data accumulates. While you'll be loosely monitoring the main models' record count, some supportive database...

When using Chrome for Selenium tests, the chromedriver binary will be used to control Chrome. To debug problems that stem...

There are several ways to merge two (or more) PDF files to a single file using the Linux command line...

MariaDB (and MySQL) is released in different versions with different behaviors. For backwards compatibility this can be managed with the...

You can share a state in Ruby with global variables. Even if you should avoid them whenever possible, for debugging...

blog.cloudflare.com

Two weeks ago, Cloudflare was struck by a global outage that lasted ~30 minutes. The incident was rooted on a...

makandra dev

webpack is a very powerful asset bundler written in node.js to bundle (ES6) JavaScript modules, stylesheets, images, and other assets...

RubyMine comes with a nice way to grep through your project's files: The finder (ctrl + shift + f). Don't...

With ActiveType 1.2 you can modify associations (has_many etc.) after they have been defined. One common use case for...

makandra dev
github.com

Katapult was an endeavor to dramatically speed up starting a new Rails application. However, it turned out to save less...

Travis changed their default distribution from Ubuntu 14.04 (trusty) to 16.04 (precise). This might break your test setup for new...

Not all versions of Node.js are compatible with each other. Also npm packages may require a minimum or maximum version...

If you get requests with values for formats like this: {:locale=>[:de], :formats=>["../../../../../../../../../../etc/services{{"], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby...

Download buttons can be difficult to test, especially with Selenium. Depending on browser, user settings and response headers, one of...

When delivering non-public uploaded files (images, documents etc), one has to decide whether and how to do authorization. The...