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 IncrementAndDecrement | |
def increment(&block) | |
matcher = change(&block).by(1) | |
RSpec::Matchers::AliasedMatcher.new(matcher, lambda do |desc| | |
desc.gsub("changed", "incremented").gsub("change", "increment") | |
end) | |
end | |
def decrement(&block) | |
matcher = change(&block).by(-1) |
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
outdated_gems = `gem outdated` | |
regex = %r((?<gem>[\w-]+) \((?<old>[\d\.]+) < (?<new>[\d\.]+)\)) | |
gemfile = File.read("./Gemfile") | |
outdated_gems.each_line do |line| | |
data = line.match(regex) | |
gemfile.gsub!(%r(gem '#{data[:gem]}',(\s+)'[^']+'), "gem '#{data[:gem]}',\\1'#{data[:new]}'") | |
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 DelayedJob | |
module Matchers | |
def enqueue_delayed_job(handler) | |
DelayedJobMatcher.new handler | |
end | |
class DelayedJobMatcher | |
def initialize(handler) | |
@handler = handler | |
@attributes = {} |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 | |
heroku auth:login | |
heroku apps:create -s cedar $1 | |
heroku sharing:add [email protected] | |
heroku sharing:add [email protected] | |
heroku sharing:add [email protected] | |
heroku addons:add shared-database:5mb | |
heroku addons:add loggly:mole | |
heroku addons:add pgbackups:auto-month |
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 1.9 Fast require: | |
# https://gist.github.com/1008945 | |
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > load.patch | |
# Ruby 1.9.2 GC Patch: | |
# https://gist.github.com/856296 | |
curl https://raw.github.com/gist/856296/a19ac26fe7412ef398bd9f57e61f06fef1f186fe/patch-1.9.2-gc.patch > gc.patch | |
rvm install 1.9.2-p180 --patch load.patch,gc.patch -n loadgc | |
rm gc.patch load.patch |