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

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.

makandra dev
w3.org

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

In case you want to use pry with an older version of Ruby, you can try the following configurations.

Attention This is an edge-case. You probably don't want to mix different database dumps. It also requires that...

=> >> response.code => 422 FYI, the http gem is a great alternative to RestClient which behaves like that by default and has a well-designed API in general (much better than...

makandra dev

...its version number, it is considered a pre-release: 1.0.0.rc1 2.3.0.alpha2 3.0.0.beta3 4.0.0.pre.rc2 Even if a pre-release gem has the highest version number, it is...

...Semantic versioning Converted RubyGems version 1.0.0-rc1 1.0.0.pre.rc1 2.3.0-alpha2 2.3.0.pre.alpha2 3.0.0-beta3 3.0.0.pre.beta3 Note that npm packages force you to use Semantic Versioning's naming convention...

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

...to work as expected Good Then the crontab -l output will look like this: # Begin Whenever generated tasks for: some-app_staging 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS...

...value, that can not be replaced by Whenever (the release folder changes every deploy): # Begin Whenever generated tasks for: /var/www/some-app_staging/releases/20201215171150 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS_ENV=staging...

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

...also packaged as a snap. A snap will always track a channel (like stable, beta) and automatically update to the newest version available in this channel. By default the snap...

channels: stable: 2018.3.2 (72) 269MB classic candidate: 2018.3.2 (72) 269MB classic beta: 2018.3.2 (72) 269MB classic edge: 2018.3.2 (72) 269MB classic 2018.3/stable: 2018.3.2 (72) 269MB classic 2018.3/candidate...

tl;dr: Avoid to memoize methods with default (keyword) arguments! When you are using Memoized with default arguments or default...

If you want to see how long your database queries actually take, you need to disable MySQL's query cache...

Imagine you want to write a cucumber test for a user-to-user chat. To do this, you need the...

Browsers blocks abusable JavaScript API calls until the user has interacted with the document. Examples would be opening new tab...

If your Webpack build is slow, you can use the Speed Measure Plugin for Webpack to figure out where time...

Intel CPUs receive updates, including security relevant upgrades, through 2 channels: Firmware/UEFI BIOS updates can also update the microcode in...

Usually you add errors to :base in ActiveRecord, in case no appropriate attribute could be used to add the error...

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

PostgreSQL and ActiveRecord have a good support for storing dynamic attributes (hashes) in columns of type JSONB. But sometimes you...

You can tell npm to install a package globally with npm -g install @puppeteer/browsers. However, it seems that its not...