makandra dev

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...

makandra dev

If you want Sidekiq to be able to talk to Redis on staging and production servers, you need to add...

ruby-lang.org

Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...

github.com

When handling nested hashes the RSpec output is often hard to read. Here the gem super_diff could help.

We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...

makandra dev
tpgi.com

These are the top ten accessibility errors as researched by TPGi, a company focusing on accessibility. See the linked article...

makandra dev
github.com

...large number of ActiveRecord objects only to collect its ID. Edge Rider has a better way. Your relations gain a method #collect_ids that will fetch all IDs in a...

...number of ActiveRecord objects only to collect its column value. Edge Rider has a better way. Your relations gain a method #collect_column that will fetch all column values in...

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

DirectUpload allows you to upload files to your file storage without having to wait for the form to submit. It...

In Capistrano 3, your Capfile requires 'capistrano/rails/migrations', which brings two Capistrano tasks: deploy:migrate and deploy:migrating. The former checks...

makandra dev

...installation supports YJIT, by running: $ ruby --yjit -v ruby 3.3.4 (2024-07-09 revision be1089c8ec) +YJIT [x86_64-linux] If YJIT is not available, the output of this command will...

...time of queries. While they serve similar purposes they do have some differences in behavior and implementation. PostgreSQL Timeout Type: statement_timeout Scope: Applies to all types of SQL statements...

...INSERT, UPDATE, DELETE). Units: Can be specified in various time units (milliseconds, seconds, minutes). Behavior: If any statement exceeds the specified timeout, PostgreSQL raises an error indicating the statement was...

blog.saeloun.com

Rails' fragment caching caches subtrees of an HTML document tree. While constructing that tree though, it can be really hard...

If your app does not need to support IE11, you can use most ES6 features without a build step. Just...

When you don't only have a favicon.ico in your project but also PNGs of different sizes and backgrounds, you...

...you obviously do not want to duplicate it and your tests might very well benefit from this approach. Use it with care, however -- doing this more than a few times...

...making the test impossible to read). An alternative is also to hide that functionality behind other steps that do more complex things differently...

When you find similar groups of expect calls in your tests, you can improve readability by extracting the group into...

By default subscript ( ) and superscript ( ) tags are styled with vertical-align: sub, respectively vertical-align: super by most browsers.

...intensive for large files Other ways to solve this problem Other solutions might work better and make more sense depending on what you are trying to achieve. These alternatives could...

When you repeat complex assertions in your tests multiple times, it might be a good idea to extract a custom...

The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...

makandra dev

Knowing when to refactor Just feeling like refactoring is not a good reason to do it. Make an educated decision...

This cards describes an example with a Github Client on how to keep your Rails application more maintainable by extracting...

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