makandra is responsible for maintaining about 75 Ruby projects. These projects use a large number of different versions for Ruby...
This card will show you how to use git rebase --onto without confusion. Use case You've got two feature...
Fill in find field with e.g. url (? .*?) Hint: the "url" at the beginning of the string is just a text fragment; the (? .*?) is our named capture group.
Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...
In an environment: config.logger = Logger.new('/dev/null')
Hint This applies only to distributions based on Debian. Requirement You need to setup the PostgreSQL Apt Repository first.
...to e.g. lock an entire form while it is being changed. This requires code beyond database locking, in both backend and frontend...
Looking at the source code of the validates_numericality_of validator, it becomes clear that it converts the attribute in question to either an integer or float: if configuration[:only...
...ActiveRecord::Errors.default_error_messages[:not_a_number]) next end raw_value = raw_value.to_i else begin raw_value = Kernel.Float(raw_value.to_s) rescue ArgumentError, TypeError record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default...
This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...
TL;DR There are three dimensions you can control when scoping routes: path helpers, URL segments, and controller/view module.
When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc.
If you want to collapse/expand elements with dynamic content (and thus unknown height), you can not transition between height: 0...
If you want someone to be able to access your rails console, but don't want them to be able...
...why we should always use ===, never == Testing the type of a value Understand the benefit of LoDash's _.isEqual What the f*ck JavaScript? Understand that there is no way...
...a callback function which can write it to console.log. Understand why each code block behaves the way it does: Variant 1: Iterating with forEach's callback function const callbacks...
Important wkhtmltopdf is deprecated and shouldn't be used anymore. Please consider switching to another tool We can install wkhtmltopdf...
...skipping asset compilation when assets have not changed? Turns out there is an even better way to speed up Capistrano deployments with asset compilation – and it's even simpler.
RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...
JSON Web Tokens are often times used for authentication delegation from one system to another. They can be decoded for...
...read and write access by methods like File.open and File.read. def exclusively_locked_access begin @file_locked = true File.open(F"#{file_path}.lock"), 'w+') do |f| f.flock(File::LOCK_EX...
...that block make sure to do that manually and preferably wrap it it with begin and rescue if something might go wrong: begin f = File.open(file, File::CREAT) f.flock(File...
When you want to group rails models of a logical context, namespaces are your friend. However, if you have a...
While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...
...all Unpoly updates work using AJAX requests, you won't get the more detailled better_errors page with the interactive REPL. Below is an event listener that automatically repeats the...
...full CSS and JavaScript. The code assumes you are using Ruby on Rails with better_errors, which is the default error view that modern Rails versions employ. If you are...
Debugging your integration tests, that run a headless Chrome inside a docker image, is tricky. In many cases you can...
In /etc/rc.local add: service bluetooth stop