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"

TeamViewer 7 finally works with multiple screens under Linux

TeamViewer 6 and lower had an issue where they would see a multi-monitor Linux setup as a single wall of pixels. This is fixed in version 7. The guest can now select the currently active screen from the TeamViewer menu.

Issues with has_select?

The handy method has_select?(field, :selected => text) does not behave as expected with Cucumber 0.10.2, Capybara and Selenium 0.2.2. It may not recognize a select field if the selected option with the text has no value. If you don't have the possibility to upgrade these Gems, probably the best way to go is to distinguish the current Capybara driver:

Then /^"([^"])" should be selected for "([^"])"(?: within "([^"]*)")?$/ do |value, field, selector|
with_scope(selector) do

# currently needed due to different behav...
External content

Moment.js - A lightweight javascript date library

A lightweight javascript date library for parsing, manipulating, and formatting dates.

CSS: Change text selection color

You can change the color for text selection via CSS, using the ::selection and ::-moz-selection pseudo-elements.

Adding this to your Sass will make all text selections use a red background:

  background-color: #f00

  background-color: #f00

Unfortunately, those can't be combined into "::selection, ::-moz-selection". Doing so will have no effect.

Auto-generate Cucumber navigation paths

Don't you just hate to write Cucumber path helpers to be able to say this?

When I go to the user form for "" # goes to edit_user_path(User.find_by_anything!(''))
When I go to the form for the user "" # goes to edit_user_path(User.find_by_anything!(''))
When I go to the form for the user above" # goes to edit_user_path(User.last)
When I go to the project page for "World Domination" # goes to project_path(Project.find_by_anything!('World Domination') …

New cards feature: Cite other cards

We've made it easier to link other cards:

  • You can now find a button Cite other card above the main text area
  • Clicking this button lets you search for another card
  • Clicking on a search result will paste a Markdown link into the text area

will_paginate on complex scopes may be slow (workaround)

will_paginate triggers a database query to determine the total number of entries (i.e. to let you display the number of search results). When you paginate complex scope (e.g. that has many includes), this query may take several seconds to complete.

If you encounter this behavior, a solution is to calculate the total count yourself and pass it to the pagination call:

scope = User.complex_scope_full_of_includes
total_number_of_users = scope.count
@users = scope.paginate(:total_entr...
External content

Convert Virtualbox .ova Image to .ovf

The .ova file format is a tar file with a .ovf file inside.
tar xvf virtualboximage.ova

Run your own code before specific RSpec examples

You probably know about the possibility to tag scenarios in Cucumber to run your own piece of code before the actual scenario is run which looks like that:

Scenario: Do something

and you place the following snippet into support/env.rb:

Before('@foo') do
  puts "This is run every time a @foo tagged scenario is hit"

You can tag RSpec examples like this:

it 'does something', :foo => true do

What you need is the following within the RSpec.configure do |config| block wit…

RestClient sends XML Accept header by default

REST Client is a nice, simple HTTP client library for Ruby.

When you do a simple GET request like that:

RestClient.get ''

it will result in this request beeing sent to

GET / HTTP/1.1
Accept: */*; q=0.5, application/xml
Accept-Encoding: gzip, deflate

The application/xml accept header might lead to unexpected results on your server. You can force REST Client to ask the server for default text/html that way:


High-level Javascript frameworks: Backbone vs. Ember vs. Knockout

This is a very general introduction to MV* Javascript frameworks. This card won't tell you anything new if you are already familiar with the products mentioned in the title.

As web applications move farther into the client, Javascript frameworks have sprung up that operate on a higher level of abstraction than DOM manipulation frameworks like jQuery and Prototype. Such high-level frameworks typically offer support for client-side view rendering, routing, data bindings, etc. This is useful, and when you write a moderately complex Javascript …

New cards feature: Github-style code blocks

You can now add code blocks without indentation, by using triple-backticks:

Code block goes here.

Sunspot and Solr on Tomcat: Trouble with Umlauts

We experienced problems with Sunspot and Solr on Tomcat: Umlauts (ä, ö, ü) were not correctly handled on Tomcat while everything was okay on the local development machines (your local Sunspot service you start with the sunspot:solr:run task is based on Jetty).

We use a stemmer that reduces "Sänger" to "sang" and "Sanger" to "sang" as well.
Though, results for "Sänger" where empty on Tomcat.

This is due to a UTF-8 bug in RSolr (see Github for some discussion on that).
The bug is fixed in a …

Nicer alternatives to def_delegator or def_delegators

Delegating methods to other objects is often helpful but the syntax of both def_delegators and def_delegator is a complete mess that makes your code hard to read.

Consider these classes:

class Topic < ActiveRecord::Base
  def title
    "A title"
  def category
    "Topic category"

class Post < ActiveRecord::Base
  belongs_to :topic

Fix YAML::Syck::DefaultKey:0x1083b59f8

When your gems complain about invalid gemspecs and illformed requirements, it is most probably an error resulting from the transition from Syck to psych. To fix this:

  1. go to your gemspec directory (e.g. /Library/Ruby/Gems/1.8/specifications/)
  2. change #<Syck::DefaultKey:0x00000100e779e8> to = (equals sign) in each file that's complaining

Letter Opener

Preview email in the browser instead of sending it.

Ruby: Indent a string

Copy the attached file to config/initializers/indent_string.rb and you can say

"foo".indent(4) # "    foo"

Note you will find many simpler implementations of this method on the Interweb. They probably won't do what you want in edge cases, fuck up trailing whitespace, etc. The implementation in this card has the following behavior:

describe '#indent' do

  it 'should indent the string by the given number of spaces' do
    "foo".indent(2).should == "  foo"

  it 'should indent multiple lines line by line' do ...

Make Capistrano use SSH Key Forwarding

When deploying code with Capistrano (depending on your configuration) at some point Capistrano tries to check out code from your repository. In order to do so, Capistrano connects to your repository server from the application server you're deploying to with SSH. For this connection you can use two SSH keys:

  • the user's ~/.ssh/id_rsa [default]
  • the very same key you used for connecting to the application server - forwarded automatically to the git repository.

If you prefer the second way, add this to deploy.rb:

2978 cards