This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAILS_ROOT/config/environments/development.rb | |
config.gem "rails-footnotes" | |
environment.rb or | |
in an initializer do: | |
if defined?(Footnotes) | |
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config/database.yml | |
config/s3_credentials.yml | |
tmp/**/* | |
.DS_Store | |
doc/api | |
doc/app | |
doc/plugins | |
doc/*.dot | |
coverage/* | |
db/*.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Simulating browser events | |
# GET a URL, following any redirects, and making sure final page is successful | |
visit "/some/url" | |
# In general, elements can be located by their inner text, their 'title' | |
attribute, their 'name' attribute, and their 'id' attribute. | |
# They can be selected using a String, which is converted to an escaped Regexp | |
effectively making it a substring match, or using a Regexp. | |
# An exception is that using Strings for ids are compared exactly (using ==) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given I am on "[page_name]" | |
When I go to "[page_name]" | |
When I press "[button]" | |
When I follow "[link]" | |
When I follow "[link]" within "[parent]" | |
When I fill in "[field]" with "[value]" | |
When I fill in "[value]" for "[field]" | |
When I fill in the following: | |
| field | value | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# don't overwrite GNU Midnight Commander's setting of `ignorespace'. | |
HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOT_BACKUP_DIR=/media/RD1000/backup | |
# A list of directories to back up. Put each on its own line | |
DIR_TO_BACKUP=`cat <<EOF | |
/home/j/backup-sync | |
/var/www | |
EOF` | |
# The rsync command with options | |
BACKUP_CMD='rsync -Rvurogptl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.container').contents().filter(function() { | |
return this.nodeType == 3; | |
}) | |
.wrap('<p></p>') | |
.end() | |
.filter('br') | |
.remove(); | |
#http://api.jquery.com/contents/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#You can just use a set difference (aka minus) to see if one array includes all elements of another | |
not_included = [1,2,3] - (1..9).to_a | |
not_included # => [] | |
not_included = [1,2,3,'A'] - (1..9).to_a | |
not_included # => ["A"] | |
#Use intersection to test if any of the one are in the other: |