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
# A DNS change to Rubygems.org is causing lingering issues. Namely, | |
# rubygems.org and production.s3.rubygems.org are still pointing to | |
# the old address. See: | |
# http://twitter.com/#!/gemcutter/status/30666857698557952 | |
# The symptoms: | |
# $ gem install benelux --version 0.5.17 | |
# ERROR: Could not find a valid gem 'benelux' (= 0.5.17) in any repository | |
# ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) |
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
<% | |
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
std_opts = "--strict --tags ~@wip --tags ~@pending" | |
std_format = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'}" | |
%> | |
default: <%= std_opts %> <%= std_format %> features | |
wip: --tags @wip --tags ~@pending --wip features | |
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip | |
detail: --tags ~@pending --wip features |
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
Format meaning: | |
%a - The abbreviated weekday name (``Sun'') | |
%A - The full weekday name (``Sunday'') | |
%b - The abbreviated month name (``Jan'') | |
%B - The full month name (``January'') | |
%c - The preferred local date and time representation | |
%d - Day of the month (01..31) | |
%H - Hour of the day, 24-hour clock (00..23) | |
%I - Hour of the day, 12-hour clock (01..12) |
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
ctrl+a or Home - Moves the cursor to the start of a line. | |
ctrl+e or End - Moves the cursor to the end of a line. | |
ctrl+b - Moves to the beginning of the previous or current word. | |
ctrl+k - Deletes from the current cursor position to the end of the line. | |
ctrl+u - Deletes the whole of the current line. | |
ctrl+w - Deletes the word before the cursor. |
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
rvm implode | |
rm ~/.rvmrc | |
curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer ; chmod +x rvm-installer ; ./rvm-installer --version 1.8.0 | |
; | |
rvm implode | |
gem uninstall rvm |
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
sudo apt-get install libxslt1-dev | |
libxml, libxml-dev, libxslt, libzslt-dev |
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
sudo port install git-core +bash_completion | |
if [ -f /opt/local/etc/bash_completion ]; then | |
. /opt/local/etc/bash_completion | |
fi | |
GIT_PS1_SHOWDIRTYSTATE=true | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_ps1 " {%s}")\[\033[00m\]\$ ' |
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
mkdir -p /Library/Application\ Support/TextMate/Bundles | |
cd !$ | |
git clone git://github.com/timcharper/git-tmbundle.git Git.tmbundle | |
osascript -e 'tell app "TextMate" to reload bundles' | |
Ctr+Shift+G => blame | |
enjoy! |
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
require "ruby-prof" | |
around_filter :profile | |
def profile | |
return yield if params[:profile].nil? | |
result = RubyProf.profile { yield } | |
printer = RubyProf::FlatPrinter.new(result) | |
File.open("profile.txt", "w+") do |f| | |
printer.print(f, {}) |
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
def options_from_collection_for_select_with_data(collection, value_method, text_method, selected = nil, data = {}) | |
options = collection.map do |element| | |
[element.send(text_method), element.send(value_method), data.map do |k, v| | |
{"data-#{k}" => element.send(v)} | |
end | |
].flatten | |
end | |
selected, disabled = extract_selected_and_disabled(selected) | |
select_deselect = {} | |
select_deselect[:selected] = extract_values_from_collection(collection, value_method, selected) |
OlderNewer