mtlynch.io

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

github.com

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

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

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

On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...

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

It sometimes happen that a database dump, that would want to insert into your development database, does not match the...

The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be...

If a model inherits from others or uses many concerns / traits, it might be hard to see in the code...

When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...

ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...

news.ycombinator.com

This is an extract from the linked article. It shows an approach on how to implement encrypted passwords with the...

A flat folder structure can be cool if you have only a few folders but can be painful for huge...

Rails 5.2+ supports "verbose query logs" where it shows the source of a query in the application log.

When you use Sentry to monitor exceptions, an important feature is Sentry's error grouping mechanism. It will aggregate similar...

Rails middlewares are small code pieces that wrap requests to the application. The first middleware gets passed the request, invokes...

If you want to prevent that two processes run some code at the same time you can use the gem...

github.com

grep is the go-to CLI tool to accomplish tasks like filtering large files for arbitrary keywords. When additional context...

If you migrate a Rails application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript...

CSP hat zum Ziel einen Browser-seitigen Mechanismus zu schaffen um einige Angriffe auf Webseiten zu verhindern, hauptsächlich XSS...

If you have a :string or :text field, you should pair it with a model validation that restricts its length...

makandra dev

# Basic HTML example # Javascript API (notable methods and properties) video = document.querySelector('video') video.play() video.pause() video.load() // Reset to the beginning and...

postgresql.org

TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...

Select2 is a fantastic library for advanced dropdown boxes, but it depends on jQuery. Alternatives Tom Select