All browsers implement an event named beforeunload. It is fired when the active window is closed and can be used to display an alert to warn the user about unsaved...

...To trigger the alert, you have to call preventDefault() on the event. Note The beforeunload event is only dispatched when the user navigation makes a full page load, or if...

docs.zizmor.sh

The linked tool can be used to scan your CI/CD workflows for potential security issues and suboptimal defaults if they...

In order to monitor a Rake task using God your Rake file must write a file with its process ID...

Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...

Just like Ruby Gems tag their version releases to the corresponding Git commit, it can be helpful to track production...

Investigate why mails are frozen The exim documentation says: Freezing occurs when a bounce message encounters a permanent failure because...

With Ubuntu 24.04 it's not longer possible to setup FDE with BTRFS The new installer won't offer you...

In tests, it is sometimes useful to create records with specific ids. On PostgreSQL this can cause problems: Usually, PostgreSQL...

Partials always define a local variable with the same name as themselves. E.g. when you are in _recent_users.html.erb, a local...

github.com

ruby-warning adds custom processing for warnings, including the ability to ignore specific warning messages, ignore warnings in specific files/directories...

atlassian.com

Git log offers useful options for filtering. This card provides a short overview. By message Only commits that include a...

I recently built a screen with a very high and wide table in the center. This posed some challenges:

When your Rails application is using Redis as its cache store, this is how you can list existing keys:

thejh.net

What you copy may not be what you see in the browser. Here is an online tool to determine the...

The change_column method for rails migrations support casting with a custom SQL statement. This allows us to change a...

...machine is usually on a very good network connection. To test how your application behaves on a slow network (e.g. mobile), you can simulate limited bandwidth. Chrome

When you need to insert many records into the same table, performance may become an issue. What you can do to save time is to open a transaction and save...

You can unpack a .tar.gz file into the current directory like this: tar -xzvf archive.tar.gz The options used are

If you are using git submodules in Gitlab CI, you might run into a "The project you were looking for...

Reacting on a class getting added can be done with a mutation observer. Example: const items = document.querySelectorAll('.item') const expectedClass...

github.com

Looks simpler than inaction_mailer: gem install mailcatcher mailcatcher Setup Rails to send mails to 127.0.0.1:1025. Usually you want...

docs.sentry.io

You can report CSP violations to Sentry. Within config/initializers/content_security_policy.rb: Rails.application.configure do config.content_security_policy do |policy| # Settings for the policy...

...emoji picker that also uses Control+Shift+E to open. You can change this behaviour by opening the ibus setup from the console: ibus-setup A window will open and...

SimpleForm is a great approach to simplifying your forms, and it comes with lots of well-defined input types. However...