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

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

...HTML elements can automatically start playing when the autoplay attribute is set on them. Except for when they can not...

Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...

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

Rails has the handy controller method send_file which lets us download files easily. We can decide whether the file...

If a Cucumber run deletes your application directory, an integration fail between Capybara and Capybara Screenshot may be the cause...

If you update Selenium regularly, you'll run into deprecation warnings similar to: WARN Selenium [:clear_local_storage] [DEPRECATION] clear...

chrisboakes.com

Debouncing a method call delays its execution until after a specified time has passed. If it's called again before...

makandra dev

...is no longer established using sudo per default. Databases created for local development usually belong to the local user an therefore do not need to be accessed using sudo...

The tree command will show you the contents of a directory and all its sub directories as a tree:

makandra dev

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

To run additional code before an existing Rake tasks you can add a dependency like this: task :before_task...

web.archive.org

Rails 6.1 has a "strict loading" mode that forces the developer to preload any association they plan to use. Associations...

Use option:checked to find the currently selected option: select.querySelector('option:checked') Yes, :checked, not :selected. This is the same...

To use a form model with devise, you can simply override #resource_class in a controller. A typical use case...

Ruby methods which load from a Yaml file, like YAML.safe_load or YAML.safe_load_file, support passing freeze: true to...

github.com

...spawns another process to run a browser, it will inherit the environment and also believe it lives in that zone. To do so, run the following code before your test...

selenium.dev

...Chrome for Testing if none is found on the system. I worked around this behavior by setting the path to the binary in the selenium initializer Capybara.register_driver :selenium do...

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

Added: State machine can now use the :prefix-option to avoid name collision if you define multiple state machines on...

With this command you can run all the spec files which have been edited or added in the current branch...

If you want to move a complete commit from one repository to another (and you don't want to add...

...applications with forms (warp_params will do that for you). But maybe its a better idea to stick to a standard that client libraries know to handle. Tests

...really nice and we implemented it in a similar way like here. In the beginning we tried to remove any duplicated in the schema files. So when a booking had...