TL;DR Avoid before(:context) (formerly before(:all)), use before(:example) (formerly before(:each)) instead. If you do use before...
The ActionMailer in Rails 2 depends on a buggy version of TMail, which sometimes inserts a blank line into the...
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...
Given you store files on Amazon S3 and you need to stream those files out to people while you don...
Ever wanted autocompletion for paths from paths.rb in Cucumber? This card lets you write your steps like this:
StaticMatic is a nice tool to build simple static websites. In case you want to have some nifty styles on...
Trick: Do not use convert but mogrify: mogrify -resize 50% * This overwrites the original image file. In contrast, convert writes...
If you type a command in your bash that doesn't exist you get this: bash: foo: command not found...
Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...
Interesting interview with DHH, where he talks about how they made the new Basecamp feel very fast without using a...
If you have an html_safe string, you won't be able to call gsub with a block and match...
If (for some reason that you don't want to ask yourself) you need to know all classes that define...
In a nutshell: return statements inside blocks cause a method's return value to change. This is by design (and...
If you get errors from your development WEBrick that contain unicode salad, you are probably requesting the page via SSL...
A print stylesheet is easy to create. Choose a font suited for paper, hide some elements, done. Unfortunately print stylesheets...
Tempfiles get deleted automatically With the the ruby Tempfile class you can create temporary files. Those files only stick around...
This article describes how to reset MySQL's or MariaDB's root password on your workstation. It's meant for...
There are many fun Unicode characters like ▲ or ☯. You might be tempted to use them for graphical elements in lieu...
Assuming the following sunspot setup of the post class: class Post < ActiveRecord::Base searchable do text :title string :state
Note: Instead of using the method in this card, you probably want to use ActiveType's nested attributes which is...
Every now and then, Java is subject to security issues where code can break out of Java's sandbox and...
When committing, you should always check the diff of your changes so you don't include any leftovers or irrelevant/bad...
Sometimes you need to look at the filter chain in specs. You can do it like that on Rails 2...
If you encounter a Firefox that does not care about your font settings but always uses specific fonts, you can...