If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...

Git commits should be very deliberate, and only contain changes that you really want to be in there. In order...

If some AJAX functionality does not work, but you see Firefox making an OPTIONS request, the reasons is most likely...

You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...

Capybara uses www.example.com as the default hostname when making requests. If your application does something specific on certain hostnames and...

makandra dev
github.com

The gem author Jonas Nicklas highlights in a Google Groups post that the release is not backwards compatible to 1...

Since I use this a lot in my daily work and there were no scripts working properly for me, I...

stevesouders.com

You can use scheme-less URLs (or protocol-relative URLs) to have browsers use the current protocol (HTTP or HTTPS...

developer.mozilla.org

Having your site run on SSL is worthless when you include content over an unsafe connection (HTTP).

Generally, Selenium tests use the browser to interact with the page. If it's unavailable, a timeout error is...

If you're using the Capybara webdriver, steps sometimes fail because the browser hasn't finished loading the next page...

stackoverflow.com

url = 'http://www.foocorp.com/foo/bar' URI.parse(url).host # => www.foocorp.com Note that this will raise an error if the given argument is...

If you require your Rails models manually, pay attention to the path you use. Unless you have...

makandra dev
github.com

Richard Powell presents a collection of CSS styling advice that's mainly taken from SMACSS. Although at makandra we're...

Example task: Multiply the table holidays between several stages. Open two terminals: shell-for stage_1 shell-for stage_2...

to_file has been removed in Paperclip 3.0.1. Instead of using File to access Paperclip storage objects (like this: File.read...

makandra dev

Today I got a better understanding of how git works, in particular what git checkout and git reset do.

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

Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...

When you get an error like this: Invalid gemspec in [/opt/www/foo-project.makandra.de/shared/bundle/ruby/1.8/specifications/carrierwave-0.6.2.gemspec]: Illformed requirement ["# 1.1.4"] ... the machine's Rubygems needs to...

We frequently use the handy Paperclip Gem to manage file attachments. If you need to move the files from local...

If you get errors from your development WEBrick that contain unicode salad, you are probably requesting the page via SSL...