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 | |
if [ ! `git diff --name-only HEAD@{1}..HEAD Gemfile Gemfile.lock | wc -l` -eq 0 ] | |
then | |
echo -e "\033[0;31m*** Gemfile change detected, running bundle check ***\033[0m" | |
(unset GIT_DIR ; bundle check || bundle install --local || bundle install) | |
fi |
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
git checkout master | |
git pull | |
git remote prune origin | |
git branch -r --merged | grep bquorning | awk -F'/' '{ print ":" $2 "/" $3 }' | xargs git push origin | |
git branch --merged | grep -v "\* master" | xargs git branch -d | |
# That was actually a somewhat simplified version. Here's what I really use: | |
git checkout master && git pull && (git remote prune origin && git branch -r --merged | grep bquorning | awk -F'/' '{ print ":" $2 "/" $3 }' | xargs git push origin) & ; git branch --merged | grep -v "\* master" | xargs git branch -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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
# Don't need passwords in test DB to be secure, but we would like 'em to be | |
# fast -- and the stretches mechanism is intended to make passwords | |
# computationally expensive. | |
module Devise | |
module Models | |
module DatabaseAuthenticatable | |
def valid_password?(password) | |
return false if encrypted_password.blank? |
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 Payex | |
mattr_accessor :account_number | |
mattr_accessor :encryption_key | |
MD5_CHECK_FIELDS = { | |
"pxorder/pxorder.asmx/Initialize7" => [:accountNumber, :purchaseOperation, :price, :priceArgList, :currency, :vat, :orderID, :productNumber, :description, :clientIPAddress, :clientIdentifier, :additionalValues, :externalID, :returnUrl, :view, :agreementRef, :cancelUrl, :clientLanguage], | |
"pxagreement/pxagreement.asmx/CreateAgreement3" => [:accountNumber, :merchantRef, :description, :purchaseOperation, :maxAmount, :notifyUrl, :startDate, :stopDate], | |
"pxagreement/pxagreement.asmx/DeleteAgreement" => [:accountNumber, :agreementRef], | |
"pxorder/pxorder.asmx/Complete" => [:accountNumber, :orderRef], | |
"pxagreement/pxagreement.asmx/AutoPay2" => [:accountNumber, :agreementRef, :price, :productNumber, :description, :orderId, :purchaseOperation], |
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
Errno::EINVAL (Invalid argument): | |
redis (2.1.1) lib/redis/connection.rb:46:in `write' | |
redis (2.1.1) lib/redis/connection.rb:46:in `write' | |
redis (2.1.1) lib/redis/client.rb:60:in `process' | |
redis (2.1.1) lib/redis/client.rb:59:in `each' | |
redis (2.1.1) lib/redis/client.rb:59:in `process' | |
redis (2.1.1) lib/redis/client.rb:154:in `ensure_connected' | |
redis (2.1.1) lib/redis/client.rb:180:in `ensure_connected' | |
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize' | |
redis (2.1.1) lib/redis/client.rb:176:in `synchronize' |
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 | |
grep_result = `grep -ri "def " #{ARGV.join(' ')}` | |
methods = grep_result.split("\n").collect do |line| | |
line[/.*:\s+def ([a-z_]+)(\((.*)\))?/i, 1] | |
end | |
filtered_methods = methods.uniq - ["initialize"] | |
dirs = (Dir.glob("*") - ['vendor', 'log']).join(" ") |
NewerOlder