josh.github.io

li.active a:link Example output (specificity): | 0 | 2 | 2 | See also: https://www.codecaptain.io/tools/css-specificity-calculator

While you are probably using will_paginate to paginate ActiveRecord scopes, it can actually paginate plain Ruby arrays. The resulting...

When doing a git blame, git will blame the person who added or removed white space in a line (e.g...

Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.

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

Xfce gives you a million options to configure your panels. Together with Xfce's sometimes arcane configuration UI, this can...

Global keyboard shortcuts can be configured in two separate panels in the Xfce Settings manager: Shortcuts related to managing windows...

In Rails 2, when calling instance_eval or instance_exec on a scope, the scope will fetch its records from...

Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...

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

Browser rendering engines are very slow at rendering large box shadows. I had a situation where a complex layout with...

makandra dev
github.com

Show failing specs instantly. Show passing spec as green dots as usual. Configuration: # spec/spec.opts (.rspec for rspec 2) --require rspec/instafail...

makandra dev
speakerdeck.com

The linked slidedeck holds many tips, of which I list the most interesting to me below DATA and END

Ruby's mathn library changes Fixnum division to work with exact Rationals, so 2 / 3 => 0 2 / 3 * 3 => 0...

makandra dev

Browsing the git stash is a bit tricky. Here is how to see the changes without applying them:

There is no reason to leave trailing whitespace characters in your project's files, so don't add any.

The ActionMailer in Rails 2 depends on a buggy version of TMail, which sometimes inserts a blank line into the...

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

If you have an html_safe string, you won't be able to call gsub with a block and match...

This works in modern RSpecs (RSpec >= 2.x) and Cucumbers: rspec spec/models/node_spec.rb:294:322 cucumber features/nodes.feature:543:563:579

Assuming the following sunspot setup of the post class: class Post < ActiveRecord::Base searchable do text :title string :state

Jedes nicht rein private Profil auf Social Media Portalen muss ein Impressum haben, das heißt insbesondere Unternehmen und Freiberufler (§ 5...

Sometimes you need to look at the filter chain in specs. You can do it like that on Rails 2...

makandra dev
twitter.github.com

Explanation of the "bootstrap 2" base CSS. Contains information about: Typography Code Tables Forms Buttons Icons