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
module AuthenticationHelpers | |
def log_in_as(model) | |
login_as(model) | |
end | |
end | |
RSpec.configure do |config| | |
config.include AuthenticationHelpers, :type => :request | |
config.include Devise::TestHelpers, :type => :controller | |
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
" ,W to strip all trailing whitespace | |
nnoremap <leader>W mZ:%s/\s\+$//<cr>:let @/=''<CR>`Z | |
" Display trailing spaces and tabs differently. In this case, | |
" show them as dark grey, and with certain characters. | |
set list listchars=tab:⇀\ ,trail:. | |
:highlight SpecialKey ctermfg=darkgrey guibg=black |
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
# Add our current git branch out to our path | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
format_git_branch() { | |
parse_git_branch | sed -e 's/\(.*\)/(\1)/' | |
} | |
rvm_prompt() { |
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
{ | |
"Statement": [ | |
{ | |
"Sid": "Stmt1344909032464", | |
"Action": [ | |
"s3:*" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::BUCKETNAME", |
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
(-10..-5).include?(-7) | |
#=> true | |
(-5..-10).include?(-7) | |
#=> false | |
(10..5).include?(7) | |
#=> false | |
(5..10).include?(7) | |
#=> true | |
# OK, so maybe 10..5 wraps the whole set of integers? |
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
#!/bin/bash | |
# Author: Jason Stirk (http://griffin.oobleyboo.com) | |
# Simple growlnotifu wrapper using return values | |
# Usage: | |
# aa <command to execute> | |
# | |
# If the command returns with a successful return value, growlnotify will | |
# be executed and will show the command used. | |
# If the command returns a failure (non-zero) return value, growlnotify will | |
# show the same message, but will include the "critical" urgency, which will |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal �SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x00000001090a3b11 _ZN8rubiniusL12segv_handlerEi + 241� | |
1 libsystem_c.dylib 0x00007fff8e264cfa _sigtramp + 26� | |
2 ??? 0x00007fff68c85330 0x0 + 140734951346992� | |
3 libcrypto.0.9.8.dylib 0x00007fff954133e4 CRYPTO_set_ex_data + 36� | |
4 openssl.bundle 0x000000010c7ef699 ossl_x509store_set_vfy_cb + 57� |
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
module ActiveSupport::Rescuable::ClassMethods | |
alias :old_rescue_from :rescue_from | |
def rescue_from(*k,&b) | |
Rails.logger.debug "rescue_from!!!!! #{self.name} (#{k.inspect})" | |
Rails.logger.debug caller.join("\n") | |
old_rescue_from(*k, &b) | |
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
module AA | |
module BB | |
module CC | |
end | |
end | |
end | |
class Foo | |
include AA::BB | |
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
#!/usr/bin/env ruby | |
# Quick and dirty FSEvent watcher. | |
# Example: | |
# rr spec/lib/foo lib/foo 'spec spec/lib/foo/*_spec.rb' | |
# | |
# Will watch the spec/lib directory for any changes, and run the given command for each change, | |
# dumping the output to STDOUT. | |
require 'rubygems' | |
require 'rb-fsevent' |
NewerOlder