When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...

Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...

If you are using PDFKit / wkhtmltopdf, you might as well want to use custom fonts in your stylesheets. Usually this...

Download the dictionary from http://www.winedt.org/dict.html, e.g. http://www.winedt.org/dict/de_neu.zip unzip de_neu.zip mkdir ~/Documents/dic iconv -f UTF-16 -t...

reactarmory.com

The linked article shows how to exploit websites that include unsanitized user input in their CSS. Although the article often...

Let's say you have a form that you render a few times but you would like to customize your...

There are several gems that make it easy to read and process xlsx files. Parsing the entire file at once...

When localizing model attributes via I18n you may run into errors like this: I18n::InvalidPluralizationData: translation data {...

...} can not be...

gist.github.com

Here is some JavaScript code that allows you to click the screen and get the clicked element's text contents...

I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...

If you want to ssh into your vagrant box without switching into the project directory and typing vagrant ssh, you...

There are many approaches out there how you can import data from a legacy application to a new application. Here...

You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...

Native promises have no methods to inspect their state. You can use the promiseState function below to check whether a...

github.com

rack-cargo gives your API a new /batch route that lets clients perform multiple API calls with a single request...

ActiveRecord::RecordNotFound errors provide quite meaningful error messages that can provide some insight on application details. Consider the following:

api.rubyonrails.org

Rails 5 (don't know about the others) comes with an initializer wrap_parameters.rb. Here you can tell rails to wrap...

Put the line below in the respective env.rb file to make your action controllers raise an ActionController::UnpermittedParameters error when...

Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...

github.com

When storing a file with Carrierwave, it is always cached prior to actually storing it (to support form roundtrips).

This card will show you a cool way to define a class using Struct.new. A common usecase for Structs are...

Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...

makandra dev

If you use the Better Errors gem, you will sometimes notice that it can be very slow. This is because...

Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...