Search_spinner Cross_grey Magnifier

Search syntax

  • Search for repeating cards with repeats:yes
  • Search for unfinished cards with unfinished:yes
  • Search for cards in a certain topic with topic:"name"
  • Search for phrases with "a phrase"
  • Exclude a word from search: -word
  • Exclude a phrase from search: -"a phrase"
  • Exclude a topic from search: -topic:"name"
External content

jQuery 1.7 Released

Two new methods on and off are the new way of declaring event handlers. bind, delegate and live area deprecated. Also better performance for delegated events.

"Show me the page" fails to open a browser window

If you get an error like this:

Unable to launch /home/bruce/Projects/myproject/tmp/capybara/capybara-201110311210111407691101.html 

… update your launchy gem. It failed for us in version 0.4.x. We could fix the issue by upgrading to 2.0.5.

How the Clearance gem remembers and clears sessions

Clearance is a gem that provides authentication functionality (e.g. login, logout). This note explains, how the clearance login, logout and (in old Clearances) remember me functionality works.


Clearance defines a database column called “remember_token”. When you login in, that token will be saved in a cookie. For that reason you don’t have to re-sign-in when you close and open the browser again.
This also means that you can be logged in in more than a single browser. Also see [When ses…

Connect to a VirtualBox guest machine over the network

You must reconfigure the guest so it will get its own IP address:

  • Shutdown the guest
  • In the guest’s VirtualBox settings, choose Network and switch the network adapter type to Bridged
  • Restart the guest
  • Read the guest’s IP address from the output of ifconfig (Unix) or ipconfig (Windows)
  • You can now connect to this IP address using HTTP, SSH, etc.

Note that by doing this your VirtualBox guest is fully exposed on the local network, just like your host machine.

Micro clearfix mixin for Sass

Clearfix is a hack to clear floating elements without additional HTML markup.

If you only need to support IE8 and above, a great clearfix with little to no side effects is:

    content: ""
    display: table
    clear: both

Compass also gives you a mixin from compass/utilities/general/clearfix, but that adds overflow: hidden to your container.

Stub methods on any instance of a class in Rspec 1 and Rspec 2

RSpec 1 (Rails 2)

With the most recent spec_candy.rb helpers you can say:

User.stub_any_instance(:foo => :bar)
user =
# => :bar

RSpec 2 (Rails 3)

RSpec 2 comes with this feature built in:

User.any_instance.stub(:foo => :bar)
user =
# => :bar

Ruby: Downloading files

This is easy:

require 'open-uri''/target/path/to/downloaded.file', "wb") do |file|
  file.write open('').read

#Basic Authentication
When your file is protected by HTTP Basic Authentication, pass your credentials as hash:'/target/path/to/downloaded.file', "wb") do |file|
  file.write open('', :http_basic_authentication => [your_username, your_password]).read

Rails 3.1 error message: Could not find a JavaScript runtime

After starting the Rails server in a freshly generated Rails 3.1 project you could see an error message such as

/usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See for a list of available runtimes. (ExecJS::RuntimeUnavailable)

Just add a JavaScript runtime to your Gemfile and the error vanishes.


gem 'therubyracer'
gem 'extjs'

Change the MySQL default character set on Amazon Relational Database Service (RDS)

Look here for informations how you can show the MySQL default character set.

At first you need the Amazon RDS Command Line Toolkit

  • download and unzip the [Amazon RDS Command Line Toolkit](…

Make Type 1 fonts (.pfb/.pfm) appear in OpenOffice on Ubuntu Linux

When you install Type 1 fonts (like makandra’s corporate typeface), they won’t show up in OpenOffice. OpenOffice requires some additional files to process them. Stefan Gründel found out what to do.

There is a tool that can produce the missing files:

sudo apt-get install t1lib-bin

Now you can create .afm files:

cd ~/.fonts
type1afm *.pfb

Restart OpenOffice and the fonts should show up.

Cucumber.yml was found, but could not be parsed.

If you encounter the error message above when running cucumber, just execute…
rm rerun.txt …in the Rails directory.

Or run…
tests …from the geordi gem. This will do the work for you automatically.

Solve screen error "Cannot open your terminal '/dev/pts/0' - please check"

When using the screen tool you may be unable to start a screen session but instead encounter an error:

Cannot open your terminal '/dev/pts/0' - please check.

This is because another user (you) initiated the current terminal – you probably did a sudo su into the user you are now trying to run screen as, right?

There are two ways to resolve this:

  • Sign out and properly connect / sign in as the user you wish to use.
  • Run script /dev/null to own the shell (more info over at [Server Fault](…

Multi-line Ruby block in Haml

There are several options, but most of them are impractical. The best way is to use the :ruby filter:

  puts javascript_include_tag(
    :cache => true

Web font embedding requires new CSS for IE9

If you embedded web fonts in the past years (e.g. by copying CSS from a Font Squirrel @font-face kit), that CSS won’t work in Internet Explorer 9.

You can fix it by turning these styles…

  font-family: 'MyFont'
  src: url('myfont.eot')
  src: local("☺"), ('myfont.ttf') format("truetype")
  font-weight: normal
  font-style: normal

… into these:

  font-family: 'MyFont'
  src: url('myfont.eot')
  src: local("☺"), url('myfont.e...

Improve web font rendering in Windows by autohinting fonts

Web fonts are awesome. After being restricted to Arial for two decades there is finally a cross-browser way to embed fonts into web pages.

Unfortunately while web fonts look awesome on Linux and MacOS, they look horrible on Windows, a problem that gets worse with smaller font sizes.

The culprit is something called font hinting:

Give table columns equal width using CSS

If you want to distribute a <table>’s width equally over its columns, you can use the following CSS property:

table-layout: fixed

It is supported by every browser ever.

/proc/cpuinfo on Solaris

When used to do:

$> cat /proc/cpuinfo 
processor : 0 
vendor_id : GenuineIntel 
cpu family : 15 
model : 4 
model name : Intel(R) Xeon(TM) CPU 3.00GHz 
stepping : 1 
cpu MHz : 2992.785 

Instead, on Solaris, use psrinfo(1M)

$> psrinfo -v 
Status of virtual processor 0 as of: 09/17/2006 21:45:32 
on-line since 08/24/2006 16:16:03. 
The i386 processor operates at 1800 MHz, 
and has an i387 compatible floating point processor. 
Status of virtual processor 1 as of: 09/17/2006 21...

Show the character set and the collation of your MySQL tables

To show the collation of your tables you have to login to the MySQL console and execute SHOW TABLE STATUS FROM database;

| Name        | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_leng...
2808 cards