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
~/.irbrc | |
if rails_env = ENV['RAILS_ENV'] | |
# Called after the irb session is initialized and Rails has | |
# been loaded (props: Mike Clark). | |
IRB.conf[:IRB_RC] = Proc.new do | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.instance_eval { alias :[] :find } | |
end | |
end |
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
# From http://github.com/jaymcgavren | |
# | |
# Save this as rcov.rake in lib/tasks and use rcov:all => | |
# to get accurate spec/feature coverage data | |
# | |
# Use rcov:rspec or rcov:cucumber | |
# to get non-aggregated coverage reports for rspec or cucumber separately | |
require 'cucumber/rake/task' | |
require 'spec/rake/spectask' |
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
autospec-all: --require features --require lib --format progress features | |
autospec: --require features --require lib features | |
default: --format pretty | |
html: --format html --out features.html |
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
--colour | |
--format specdoc | |
--loadby mtime | |
--reverse |
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
ENV["RAILS_ENV"] ||= "cucumber" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
require 'cucumber/formatter/unicode' | |
require 'cucumber/rails/rspec' | |
require 'cucumber/rails/world' | |
require 'cucumber/rails/active_record' | |
require 'cucumber/web/tableish' | |
require 'webrat' |
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
# http://innig.net/software/ruby/closures-in-ruby.rb | |
# CLOSURES IN RUBY Paul Cantrell http://innig.net | |
# Email: username "cantrell", domain name "pobox.com" | |
# I recommend executing this file, then reading it alongside its output. | |
# | |
# Alteratively, you can give yourself a sort of Ruby test by deleting all the comments, | |
# then trying to guess the output of the code! | |
# A closure is a block of code which meets three criteria: |
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: |
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
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
# ~/.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 |
OlderNewer