We're always striving towards keeping our website's JavaScript as small as possible. If you're using webpack(er...

makandra dev

TL;DR Most web applications do not require action on this. SameSite=None (old browser default) will continue to work...

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

An alternative of using a multiple assignment for a Regex are named groups. Especially when your Regex becomes more complicates...

To avoid multiple versions of a package, you can manually maintain a resolutions section in your package.json. We recommend you...

When doing some meta-programming magic and you want to do something for all attributes of a class, you may...

In Rails, we usually have a mailer setup like this: class MyMailer < ActionMailer::Base def newsletter mail to: 'receiver@host.tld',

From at least Rails 4, the ActionView tag helper turns Array values of HTML options into a single space-separated...

RSpec >= 3.3 added aggregate_failures, which allows multiple failures in an example and list them all, rather than aborting on...

Today's cameras create huge images, some beyond 50MB. Unless you need to offer this large files, you should always...

makandra dev

Class-level process definitions are only applied to the original file Versions are generated based on the processed original file...

Spammers have started abusing other application to send their spam. This works like this: The application has some form that...

When restoring a PostgreSQL dump using pg_restore, you usually add the --clean flag to remove any existing data from...

When building an application that sends e-mails to users, you want to avoid those e-mails from being classified...

makandra dev
developer.mozilla.org

The standard way to abort async code is that your function takes a AbortSignal { signal } property. The caller can use...

makandra dev

To restart all tasks monitored by God, don't use god restart. This command is only meant to soft-restart...

stackoverflow.com

To reload a single-item association in Rails 5+, call #reload_ : post.reload_author In older Railses you can say

When projects run for many years, they require special regular maintenance to stay fresh. This kind of maintenance is usually...

github.com

There are two ways to lock a user in devise. Using the lockable module Customizing the user account status validation...

relishapp.com

When you are using lambdas in RSpec to assert certain changes of a call, you know this syntax: expect { playlist.destroy...

github.com

This repository was created with the intention of helping developers master their concepts in JavaScript. It is not a requirement...

github.com

Setting array columns When using PostgreSQL array columns, you can set an array attribute to a value with square brackets...

docs.ruby-lang.org

Percent Notation We already know that that we can create strings using the percent notation: %(<foo="bar's ton">) is...

It is very common to parse dates from strings. It seems obvious to use Date.parse for this job. However this...