en.wikipedia.org

Although you can access many symbols using the AltGr key you may be missing some, like the en-dash (–) or...

Is your application doing something expensive every few seconds? Maybe an animated slider that rotates images? Maybe you are updating...

makandra dev

Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...

morris-photographics.com

Some browsers render PNG images with color profiles and other shenanigans, some don't. The cleanest way to have consistent...

Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting.

...It's much easier to detect the current Rails environment instead. You might be better of checking against the name of the current Rails environment. To do this, store the...

Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...

Tested on Ubunut 22.04 1. Opener script Create a file ~/.local/bin/coverage_zip_opener with: #!/bin/bash tmp_folder="/tmp/coverage-report-opener" if [ -z "$1" ]

makandra dev

We structure our CSS using the BEM pattern. Our naming convention for blocks, elements and modifiers has evolved over the years. This card shows our current style and various alternative...

...not mix styles and be consistent within a given project. Current convention Our current BEM naming convention looks like this:

Note how the modifier just starts with a dash (-pro...

Rails' default logger prefixes each log entry with timestamp and tags (like request ID). For multi-line entries, only the...

github.com

Let the following setup: # my_model_spec.rb describe MyModel do it 'perfoms a test' it_behaves_like 'something shared' end # something_shared.rb shared_examples_for 'something shared' do it 'does something'

...a test' is spec/models/my_model_spec.rb[1:1]. The ID of the ExampleGroup created by it_behaves_like 'something shared' is spec/models/my_model_spec.rb[1:2] as it is the second ExampleGroup in the...

Creating records in specs can be so fast that two records created instantly after one another might have the same...

makandra dev

This card shows you how to center a float horizontally in CSS. Also: find out what techniques are available for...

makandra dev

Field error steps Spreewald's The...

...field should have an error and The...

...field should have the error...

...steps now...

Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote...

Using Ruby 1.8.7 you will not be able to use the maximum versions Rubygems 1.8.30 and Bundler 1.17.3 with https://...

makandra dev

A primer on vector graphics For rastered image formats like JPG or PNG, each pixel is basically drawn on a...

You can not use the hash_including argument matcher with a nested hash: describe 'user' do let(:user) { {id: 1...

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...

If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...

When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...

makandra dev

...lib provides a built-in email regex URI::MailTo::EMAIL_REGEXP. That's the best solution to work with. /\A[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA...

github.com

When using Sidekiq in your application, you must write thread-safe code. This wiki page also lists gems that are...

...lot of logic and callbacks for a particular form screen, but then the model becomes a pain in tests, where all those callbacks just get in the way. Or we...

...have different forms for the same model but they need to behave very differently (e.g. admin user form vs. public sign up form). There are many approaches that promise help...