How to communicate between processes in Ruby with sockets

Posted Over 3 years ago by Emanuel.

In Ruby you can communicate between processes with sockets. This might be helpful in tests that validate parallel executions or...

Using the Truemail gem to validate e-mail addresses

Posted Over 3 years ago by Arne Hartherz.

The Truemail gem (not to be confused with truemail.io) allows validating email addresses, e.g. when users enter them into a...

Git diff: Deemphasizing code that was only moved around

Posted Over 3 years ago by Dominik Schöler.

In long diffs, it can become impossible to spot small changes in larger blocks of moved code. This may be...

How to test inside iframes with cucumber / capybara

Posted Over 3 years ago.

When testing with Cucumber / Caypbara, iframes are ignored, so you can't interact with them. To interact with your iframe...

Ruby: How to keep split delimiter (separate, or as part of substrings)

Posted Over 3 years ago by Arne Hartherz.

Ruby's String#split returns an array of substrings from the given string. Usually, this is missing the split characters...

Capybara: Running tests with headless Chrome

Posted Over 3 years ago by Henning Koch.

Headless Chrome is a way to run the Chrome browser without a visible window. Configuring Capybara Configure the Capybara driver...

SSHKit 1.9.0 failure for Capistrano deploy

Posted Over 3 years ago by Emanuel.

SSHKit 1.9.0 might fail with the following error, when trying to deploy a Rail application. Upgrading the gem to version...

Whenever requires you to set the application attribute in the Capistrano config

Posted Over 3 years ago by Emanuel.

Whenever requires you to set the application attribute in your Capistrano configuration. Otherwise your cronjobs are created multiple times.

Configuring Webpacker deployments with Capistrano

Posted Over 3 years ago by Dominik Schöler.

When deploying a Rails application that is using Webpacker and Capistrano, there are a few configuration tweaks that optimize the...

How to Make Your Code Reviewer Fall in Love with You

Posted Over 3 years ago.
mtlynch.io

Why improve your code reviews? Improving code review technique helps your reviewer, your team, and, most importantly: you.

Variable fonts for web developers

Posted Over 3 years ago by Michael Leimstädtner.

This card is mainly an explanation how variable fonts work in CSS, not necessarily a recommendation to actually use them...

Rails developers: Have better context in Git diffs

Posted Over 3 years ago by Dominik Schöler.
tekin.co.uk

Git diffs show the surrounding contexts for diff hunks. It does so by applying regular expressions to find the beginning...

Minidusen: Filtering associated records

Posted Over 3 years ago by Henning Koch.
github.com

Minidusen lets you find text in associated records. Assume the following model where a Contact record may be associated with...

Show/Hide Rubocop marking in RubyMine

Posted Over 3 years ago by Bruno Sedler.

If you have installed Rubocop in your project, RubyMine can show you Rubocop violations immediately in your editor. You probably...

How to configure file watchers in RubyMine

Posted Over 3 years ago by Michael Leimstädtner.

You need to install the official plugin, it is not bundled with RubyMine by default. Example: Setup a watcher...

Convert curl commands to ruby code

Posted Over 3 years ago by Jakob Scholz.

curl-to-ruby is a handy tool that converts your curl command to ruby code that uses the Net::HTTP...

Ruby: Comparing a string or regex with another string

Posted Over 3 years ago by Emanuel.

In Rubocop you might notice the cop Style/CaseEquality for e.g. this example: def foo(expected, actual) expected === actual end

Passive event listeners may speed up your scroll and touch events

Posted Over 3 years ago by Michael Leimstädtner.
github.com

Scroll and touch event listeners tend to be computationally expensive as they are triggered very often. Every time the event...

Ruby: A short summary of available hooks in Cucumber

Posted Over 3 years ago by Emanuel.

Here is a short summary of Cucumber hooks in Ruby taken from https://github.com/cucumber/cucumber-ruby. Note that the BeforeStep is...

How to negate scope conditions in Rails

Posted Over 3 years ago by Arne Hartherz.

Sometimes you want to find the inverse of an ActiveRecord scope. Depending on what you want to achieve, this is...

Manage Linux services on the command line (Ubuntu)

Posted Over 3 years ago.

Ubuntu 18.04 uses systemd to manage services. There are basically two commands for listing all services and manipulating the state...

Migrate gem tests from Travis CI to Github Actions with gemika

Posted Over 3 years ago by Tobias Kraze.

We currently test most of our gems on Travis CI, but want to migrate those tests to Github Actions. This...

Debugging SPF records

Posted Over 3 years ago by Daniel Straßner.

While debugging a SPF record I found spf-record.de to be very helpful. it lists all IPs that are covered by...

PostgreSQL: Importing dumps created with newer versions

Posted Over 3 years ago by Daniel Straßner.

When loading a database dump created with pg_dump into your database, you might run into an error like