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"

Improved gitpt now part of geordi

Our gitpt script to generate git commits from Pivotal Tracker stories has been tweaked and polished and is now part of the geordi gem.

Install the freshly released version 0.7 now:

sudo gem install geordi

This update will bring you gitpt with an initial “setup wizard” (that asks for your PT API key and initials) and prettier output: stories are colored by their state and …

Beware of curious behaviour of 'downcase' with umlauts

Using .downcase or .upcase on strings containing umlauts does not work as expected as it leaves the umlauts unchanged:

=> "Über"

=> "Ärger"

The very same applies for french accents (Thanks Guillaume!):

"Être ou ne pas être, telle est la question".downcase
=> "Être ou ne pas être, telle est la question"

Obviously, this leads to problems when comparing strings:
“Über”.downcase == “über”
=> false

In Rails you can use ActiveSupports’ [multibyte chars](http://apidock.c…

Fix: Cucumber won't start though cucumber.yml is correct

This is for you if you get this error:

cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.

Actually, it’s likely that your cucumber.yml is just fine but not your rerun.txt.\
This sometimes happens when running multiple Cucumber workers with parallel_tests that write into rerun.txt simultaneously – ending up with a messy, invalid file.

Just remove it and you ar…

How to embed images in higher resolutions for printing

When you print out a HTML pages, all raster images (like PNGs) will appear aliased. This is because a printer’s resolution is usually much higher than that of a computer screen.

If an image absolutely must look awesome when printed, a solution is to embed the image in much higher solution than needed (e.g. four times the horizontal resolution), then scale it down to the desired width using CSS.

Note that this will slightly alter the image’s appearance on the screen because browsers will scale down the image [using an anti-aliasing method](…

Date or datetime picker for touch devices

jQuery UI’s date picker and date time picker doesn’t work on touch interfaces.

Solution 1: Use Mobiscroll

Another way is to detect touch devices and for those devices use the Date and DateTime picker from Mobiscroll instead:

if (isTouchDevice()) {
} else...

Always sort lists that are visible in the UI

This might seem obvious, but I’m rejecting stories because of this on a regular basis.

Whenever a list (e.g. an index of records or the options of a select box) is visible in the UI that list must be sorted. Unsorted lists are completely unusable once they contain more than 5 items.

Get rid of dead keys under XFCE

Under XFCE keys like tilde are dead by default, which is impractical for programming and terminal work. To get rid of dead keys, open your Settings Manager and go to Keyboard. Under the Layout tab you can keyboard layouts like “German (eliminate dead keys)”.

There is still a way to type accented characters.

Make Makandra Consul work with RSpec 2.x and Rails 3.x

To make the RSpec matcher of the authorization solution Consul work with Rspec 2.x read the following blog post.

CSS box-shadow not working in IE9 inside tables with collapsing borders

Though Internet Explorer 9 supports the box-shadow CSS property there is a nasty bug which sometimes prevents it from rendering the shadow properly.

Consider this HTML:
<table style="border-collapse: collapse">
<div style="box-shadow: 0 0 10px #f00">Hello universe</div>

While it works in other browsers, IE9 is not showing any shadow. For some reason, it requires border-collapse: separate for the table to be set:

<table style="border-collapse: separate" ce...
External content

monperrus/ExpandAnimations - GitHub

ExpandAnimations is a LibreOffice/ Impress extension to expand presentation animations before exporting to PDF. This way the exported PDF will have one page per animation stage.

Detect mobile or touch devices on both server and client

Although it’s tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach will be painful when heavily customizing a feature beyond just tweaking the looks. Eventually you will want want the same detection logic to be available on both server and client side.

This card shows how to get a Ruby method touch_device? for your Rails views and a method TouchDevice.isPresent() for your Javascripts.

Note that we are detecting touch devices by grepping the user agent, and the ke…

How to click hidden submit buttons with Selenium

In your Cucumber features you can’t really click hidden elements when using Selenium (it does work for a plain Webrat scenario, though).

Unfortunately you need to hack around it, like this:

When /^I press the hidden "([^\"]+)" submit button$/ do |label|
  page.evaluate_script <<-JS

If your button is nested into a container that is hidden this will not do the trick. You need a more complex method to also show surrounding containers:

When /^I pre...

How to remove leading spaces from indented strings

The contents of this card are pretty old. Rails 3.0 introduces strip_heredoc which you want to use.

If you are on plain Ruby or Rails LTS 2.3, the methods below may be relevant for you.

Consider the following, when using heredoc for prettier code:

puts <<-MESSAGE
  Hello Universe!
  This is me.
External content

Firefox 3.6 Support To end On April 24, 2012

Firefox 3.6 users will receive update notifications in April offered through the browser’s internal updating service that will update the version to the latest stable build of the browser.

External content

Pull Quotes with HTML5 and CSS

A pull quote is a typographical technique in which an excerpt or quote from an article is duplicated within the article using a different formatting style so that it jumps out at the reader.

Blatantly copying the excerpt of the pull quote into it’s own element is not the way to go. A pull quote is a purely visual technique, and therefore should not change the structure of the body. Next to that, a structural representation of the excerpt would be seen twice by people using feed readers or services like Instapaper, as well as be re-read for …

German localization for Mobiscroll

If you are using Mobiscroll for date pickers on touch devices, here is how to localize the Mobiscroll UI into German:

var germanMobiscrollLocalization = {
  preset: 'datetime',
  ampm: false,
  cancelText: 'Abbrechen',
  dateFormat: '',
  dateOrder: 'ddmmyy',
  dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
  dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],

acts_as_taggable_on: Match records tagged with all, any or none of the given tags

The tagged_with scope comes with many awesome options to modify your search:

User.tagged_with("awesome", "cool")                     # Users that are tagged with awesome and cool
User.tagged_with("awesome", "cool", :exclude => true)   # Users that are not tagged with awesome or cool
User.tagged_with("awesome", "cool", :any => true)       # Users that are tagged with awesome or cool
External content

Locale: Localisation for Rails developers

A possible way for localisation in Rails applications that allows editing translations remotely.

2845 cards