We regularly need to connect to the server in order to e.g. access the production console. Guessing the Capistrano deploy user and then again guessing the right directory on the...
...even when they are wrapping the same native DOM elements: $('body') == $('body') // false In order to test if two jQuery objects refer to the same native DOM elements, use is...
To see which directories take up the most (or least) space you can order them by size like this (the -h switch does the magic of understanding humanized size...
...development, it still accepts connections from everyone in the same network as you. In order to only allow requests to your Apache coming from your local computer, edit your /etc/apache2/ports.conf...
...you want to use Require group $GROUPNAME on your default Apache installation like this: Order allow,deny Allow from all Options None AllowOverride all AuthName "Area 51" AuthType Basic AuthBasicProvider...
In order to clone a git repository including all branches and tags you need to use two parameters when cloning the old and pushing to the new repository respectively:
In order to navigate through the browser history. you can manipulate the window.history object via javascript like follows: When /^I go back in the browser history$/ do page.evaluate_script('window.history.back...
In order to chain greps on log files that are opened via tail -f test.log you have to use the --line-buffered command line option for grep. Imagine you have...
...matches. We find this behavior to be impractical, but it is by design. In order to perform a test or action in all matching elements, do not use within but...
...and produce an error: SELECT id, MIN(birthday, '1978-01-01') FROM users; In order to compute the minimum or maximum value for the current row, use LEAST and GREATEST...
no: 'Nope' ... you get this Ruby hash: { true: 'Totally', false: 'Nope' } In order to use the strings 'yes' and 'no' as keys, you need to wrap them with...
The -1 switch makes ls return 1 file per line, -t orders by modification time and -r causes sorting from oldest to newest. tail -1 then returns the...
In order to redirect all requests from redirecting-host.com to desired-host.com while keeping path and query params unchanged, change your Apache VHost to something like this: ServerName desired-host.com ServerAlias redirecting-host.com
...fails when an unknown request is happening, you have to turn it off in order to use webmock like you are used to. Here is how to do this in...
In order to cover some edge cases you rarely care about, Range#include? will become very slow in Ruby 1.9: Range#include? behaviour has changed in ruby 1.9 for non...
...HTTPS to secure their email between their browsers and Google, all the time. In order to do this we had to deploy no additional machines and no special hardware. On...
In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara: When(/^I go back$/) do visit page.driver.request.env['HTTP_REFERER']
...you want to delete from. Let's say that Post belongs_to :author. In order to delete all posts from the author named "Eric", write DELETE posts FROM posts LEFT...
...shell into Nautilus from Places -> Connect to server (select "SSH" as server type). In order to copy a file over SSH from a shell: scp filename username@remotehost:
...than one process to a version can cause MiniMagick to run multiple commands. In order to have all processing done in one mogrify system call, you'll need to define...
Ruby allows multiple assignment: a, b, c = o In order to prove multiple values from a single object, Ruby calls #to_a on the object: o = String.new('O')
Make sure you call the methods in the following order and not vice versa: has_attached_file :image validates_attachment_presence :image Validation with condition works fine, too: validates_attachment...
On your credit card summary, you will find order numbers of rides with Deutsche Bahn ("DB BAHN A-NR XYZ123") If you need to find out details about the ride...
...Selenium are very slow. You might not want to run them every time. In order to skip all Selenium scenarios, call Cucumber like this: cucumber --tags ~@javascript