Most of our applications use CarrierWave for file uploads. CarrierWave has an integrated processing mechanism for different file versions with...

Sometimes it is useful to define a named scope by implementing a static method with the scope's name on...

You can use local copies of gems in your Gemfile like this: gem 'spreewald', path: '~/gems/spreewald' As soon as you...

makandra dev

Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...

When building an application that sends e-mails to users, you want to avoid those e-mails from being classified...

Most of the time it is a tedious task to apply a code style guide to an existing code...

bundle outdated [--filter-major|--filter-minor|--filter-patch] Example output for bundle outdated --filter-major Other examples

When using Rails credentials, you will edit the encrypted credentials for staging or production environments from time to time. To...

...write <<EOT. If you do this, your terminating sequence must be at the very beginning of the line. It's less pretty and there is rarely a reason to use...

...send a merge request, please confirm that your code ... has been reviewed by yourself beforehand fulfills every requirement defined as an acceptance criterion does not have any log or debugging...

relishapp.com

When you are using lambdas in RSpec to assert certain changes of a call, you know this syntax: expect { playlist.destroy...

Sometimes we have to write code that behaves differently based on the version of a specific gem or the Ruby Version itself. The version comparison can often be seen with...

...as root for even more information and optionally also make use of stress for benchmarking, those methods did not provide any additional useful information for the current problem.

makandra dev
impactahead.com

Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...

Running gem update --system will install the latest version of RubyGems. However the latest version might not be compatible with...

...it and just builds a framework for concrete implementations. This is were another gem becomes important: database_cleaner-active_record. It provides the default ActiveRecord cleaner instance and is also...

...second database just once by using DatabaseCleaner[:active_record, db: MigrationRecord], but it's better readable and more convenient in case you want to change a strategy in the future...

developer.mozilla.org

The linked MDN article is quite informative of a neat feature supported by all major browsers: Unicode character class escape...

To keep JavaScript sources small, it can sometimes make sense to split your webpack bundles. For example, if your website...

Before you continue, ensure that you've created your certificate in the region us-east-1 (N. Virginia). Otherwise...

...as the developer of the website) to do it properly, but wants to have better proof. To this end, the advertising network (e.g. "Google Advertising Products") will register with the...

"vendor X is allowed to serve personalized advertising based on user behavior", or "vendor X is allowed to use user data to improve its algorithm" etc.

...PNG with a decent resolution (72 dpi). However, in my experience the result is better, if you set the density to a higher value and then resize to the desired...

...size. But you can just toy with those values and see what works best for you. convert -density 1200 -resize 96x96 input.svg output.png Transparency By default, your target image is...

makandra dev
content-security-policy.com

tl;dr The strict-dynamic source list keyword allows you to simplify your CSP policy by favoring hashes and nonces...

makandra dev
api.rubyonrails.org

Rails includes a way to see what an e-mail will look like. Integration to RSpec All you need to...

New versions of wkhtmltopdf dissallow file:// URLs by default. You can allow them by passing --enable-local-file-access.