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

...is a fix to SafeBuffer#gsub. Note that it will only fix the $1 behavior, not give you a safe string in the end (see below). Example def test(input...

...really expect outside code (read: Gems) to not use $1 (and there is plenty, believe me) when calling gsub on an input that may be a SafeBuffer, you need to...

...reject_if: :all_blank # Ignore the blank template record end class Image < ActiveRecord::Base belongs_to :gallery mount_uploader :teh_image, YourUploaderHere # Mount Carrierwave on attribute :teh_image end

...to automatically fix the whitespace, see below. (Note that this might lead to unexpected behaviour e.g. in Markdown documents.) The global git hooks live in $PREFIX/share/git-core/templates/hooks (where $PREFIX is probably...

chrisboakes.com

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

makandracards.com

...of time, but it will always be retried at least a second time. This behavior allows with_scope to be patient, and it must be patient, as explained below.

web.archive.org

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

makandra dev
w3.org

This decision tree describes how to use the alt attribute of the element in various situations. For some types of...

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

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

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

...Use the attached Modularity below to add such a magical array to your model. Besides using the trait, you will need to implement two methods to synchronize the string array...

For my Gem Session project Holly I ran the Ironman of drag'n'drop implementations: Dragging in nested lists

When your Rails application is using Redis as its cache store, this is how you can list existing keys:

Note: Making a reverse proxy with nginx is much more straightforward. A reverse proxy is a "man in the middle...

...its mount path. It starts with /media/. Open a terminal and sudo su to become root. We require root for everything. Use dd to create an image of your encrypted...

makandra dev

...which point the exception was thrown. def self.search_solr_with_exception_handling(*types, &block) begin search_solr_without_exception_handling(*types, &block) rescue Errno::ECONNREFUSED, Timeout::Error => e message = "Verbindung...

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

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

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

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

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