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"

Spreewald: Click on an element with a CSS selector

Spreewald 1.4.0 comes with this step:

When I click on the element ".sidebar"

We recommend to define a selector_for method in features/support/selectors.rb so you can refer to the selector in plain English:

When I click on the element for the sidebar

How to use the Capistrano shell to execute commands on servers

Capistrano brings the shell command which allows you to run commands on your deployment targets.

You can run both Capistrano tasks and shell commands, and scope to individual machines or machine roles.


First of all, spawn a Capistrano shell (we're using the multistage extension here):

cap staging shell

In your "cap" shell you can now run Capistrano tasks by prepending an exclamation mark. For example:

cap> !deploy:revision
 ** [out ::] 9aeed9030db6a7b5b4ba077337545677b4fd5c22
 ** [out :: we...

Spreewald: Check that a CSS selector is present on the current page

Spreewald 1.3.0 comes with these steps:

Then I should see an element ".panel"
Then I should not see an element ".sidebar"
Then I should see an element ".twitter-timeline"

We recommend to define a selector_for method in features/support/selectors.rb so you can refer to the selector in plain English:

Then I should see an element for a panel
Then I should not see an element for the sidebar
Then I should see an element for the Twitter timeline

Using the Bash in VI mode

Activate VI mode by running

set -o vi

Now use your Bash as if it were VI! Hit Esc to enter command mode, jump around with e, w, b, 0, $ etc. and edit just as you're used to.

Bash history is searched with /. See the linked cheat sheet for more hints.

Git: Issues with Gemfile.lock

When there's a Gemfile.lock in your working directory that you cannot remove by either checkout, reset [--hard], stash, probably Rails' Spring is the culprit.


spring stop

The author of the linked Stackoverflow post supposes Spring re-writes the Gemfile.lock on change to ensure all Spring processes are using the same gem versions. Meh.


Touch devices don't have mouseover states

This sounds trivial, but there is no such thing as a "hover" or "mouseover" state on touch devices. If your application is supposed to work on iPads, smartphones, etc., don't hide information behind a tooltip, and don't make controls appear when hovering over another element.

As a general side note, things that happen/appear when you hover an element should also do when you click the element.

restart puppetmaster after changing custom functions

The puppet master caches custom functions. If you edit an existing function (e.g. while you’re developing it), you’ll need to restart the puppet master before the new version can be used.

That also means you can't test functions in a different puppet environment. And also if you have changed functions in a different puppet environment (where you e.g. test some new module version) and this environment runs at first after a puppetmaster restart, you have this changed functions also in your production environment.


Browsers will not send a referrer when linking from HTTPS to HTTP

  • When your site is on HTTPS and you are linking or redirecting to a HTTP site, the browser will not send a referrer.
  • This means the target site will see your traffic as "direct traffic", i.e. they cannot distinguish such hits from a user who directly typed in the URL.

Reasons for this behavior

It's probably because of this RFC:

Clients SHOULD NOT include a Referer header field in a (non-secure) HTTP request if the referring page was transferr…

Auto-destruct in 58 days

Updated: How to upgrade RubyMine

Added hint to update the mine command-line launcher.

External content

Instant Markdown previews from Vim

Live markdown previewer (with Github flavored syntax) for VIM.

Will open a preview in your browser and update automatically on each key press.


How to remove all passwords from your Google Chrome sync account

Unless you're very careful with setting up Google Chrome on every device, Chrome will upload your saved username and passwords into the cloud. This way, credentials for work accounts can easily make their way into your private cellphone or other devices.

Google offers a page to remove all the passwords from your Google Chrome account.

Update: It seems not to be possible to delete e.g. only your synced bookmarks. Either all syncs or nothing.

start tcpdump log on high traffic

Logging tcpdump output all the time can create a huge amount of data. This can be both: too much data size on HDD and tiring to analyze. You can run a script in a screen which checks out the packages transfered per second and start a tcpdump when the packages exceed a fixed number.

#!/usr/bin/env bash


while /bin/true; do
pkt_old=grep $interface: /proc/net/dev | cut -d : -f2 | awk '{ print $2 }'
sleep 1
pkt_new=`grep $interface: /proc/net/dev | cut -d : -f…


How to: Start Selenium browser maximized or with custom window size

If your application requires a minimum window size (like 1024 pixels wide) and/or you have tests failing because elements are out of reach and can't be clicked, you may want to set a specific size for your browser window.

Put the following code somewhere inside features/support (e.g. env.rb) to resize your browser window for any scenario tagged @javascript.

Before '@javascript' do
  page.driver.browser.manage.window.resize_to(1024, 768)

If this does not work, try using Capybara.current_session instead of page:


Defining and calling lambdas (ruby)

There are different ways to define a lambda in ruby:

  1. with lambda-keyword

    test = lambda do |arg|
      puts arg
  2. with the lambda literal -> (since ruby 1.9.1)

    test = -> (arg) do
      puts arg

And there are different ways to call a lambda:

  1. call'hello world')
  2. Square brackets

    test['hello world']
  3. .()

    test.('hello world')

Adjust cron jobs to allow full backtraces for rake tasks

As we get an exception notification, when a cron job fails, we wish to have the full backtrace in this mail. A rake task doesn't output the full backtrace by default, so you need the --backtrace option.


You will find fail mails with a shortened backtrace

Tasks: TOP => some_namespace:some_task
(See full trace by running task with --trace)

What rake wants from you
Running the rake task like rake some_namespace:some_task --backtrace

How this works with whenever
Define a own job_type and use it for r…


Stop writing "require 'spec_helper'" in every spec

Simply add this to your .rspec instead:

--require spec_helper
External contentRepeats

Helper methods - RSpec Core

You can define methods in any example group using Ruby's def keyword or define_method method. These helper methods are exposed to examples in the group in which they are defined and groups nested within that group, but not parent or sibling groups.

2975 cards