Starting with ChromeDriver 127, if your application displays a beforeunload confirmation dialog, ChromeDriver will immediately close it. In consequence, any automated tests which try to interact with unload prompts will...

...such dialogs. This means that we want to use the BiDi driver when testing beforeunload prompts. Enabling the BiDi WebDriver Using Capybara, simply set the :web_socket_url option to...

...will be short a window manager. This might be fixable, but it's probably best to simply log out (or shut down) using the Gnome panel...

...would possibly need in a clean way, I prefer to simply always use them. Behind the scenes, Open3 actually just uses Ruby's spawn command, but gives you a much...

Open3.capture3 Basic usage is require 'open3' stdout_str, error_str, status = Open3.capture3('/some/binary', 'with', 'some', 'args') if status.success? # okay else raise "did not work" end Open3 will raise...

guides.rubyonrails.org

TL;DR Append your locale keys with _html to have them marked as html_safe and translate them with = t...

makandra dev

...number of options. Offers some pretty skins for downloading, but is hard to customize beyond that. SoundManager 2 Free. Only does audio. Awkward API. There seems to be no way...

Your development server is usually running on an insecure HTTP connection which is perfectly fine for development.

Your package-lock.json should always match and resolve all packages from your package.json. Coming from Yarn, I was looking for an...

...feature of Bundler. It might be an unintended side effect of something else. I believe this command will try to update GEMNAME and GEMNAME only. If this leads to unmatched...

...when the model has no database or database columns yet. Example: class Post < ApplicationRecord begin # Magically auto-strips all string attributes columns.each do |column| next if [:string, :text].exclude?(column.type...

Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet devices, number fields show a special virtual keyboard that shows...

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

If you are using PDFKit / wkhtmltopdf, you might as well want to use custom fonts in your stylesheets. Usually this...

github.com

This might be relevant for us since we're often managing customer documents in our apps. I played around with...

This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...

makandra dev

> {% client.global.set("auth_token", response.body.token); %} ### //Accessing a variable GET https://example.com/api Authorization: Bearer {{auth_token}} Complete documentation can be found here: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html

makandra dev

...gitignore, see https://makandracards.com/makandra/15947 [diff] algorithm = patience # A slower algorithm that sometimes produces better diffs [fetch] prune = true # Remove local remote-tracking branches that have been deleted [rebase]

main-view = date:relative author:abbreviated commit-title:graph=true,refs:true A better diff tool You may switch to delta, a fancy diff tool with syntax highlighting and...

You can use the code below to check whether the browser can make connections to the current site: await isOnline...

In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...

around do |example| superuser_power = Power.new(create(:user, :superuser)) Power.with_power(superuser_power) do # before-block will be run here, DB snapshot will be created example.run # after-block will...

bundler.io

...version you want to use for each bundler command, e.g. bundler _2.1.4_ update New behavior Bundler now honors the version specified under BUNDLED_WITH in the Gemfile.lock. The necessary version...

gem update --system Updating the bundler version for a project With the new behavior bundler should never update its version in a Gemfile.lock automatically anymore. Therefore, unless there are...

github.com

You can hook into Slack when using Capistrano for deployment. The slackistrano gem does most of the heavy lifting for...

Here are some hints on best practices to maintain your tasks in larger projects. Rake Tasks vs. Scripts The Rails default is using rake tasks for your application tasks. These...

run_script(subject, 42, 'some_arg') assert_something end end Further reading Best practices: Writing a Rails script (and how to test it...

tenderlovemaking.com

In Ruby, the meaning of protected and private is different from other languages like Java. (They don't hide methods...

...set :bundle_without, %w[development test cucumber deploy].join(' ') Be aware, that gems that belong to two groups, are only excluded, when both of the groups are excluded, e.g. to...