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
cloud-start -s config/clouds.rb | |
Starting cloud app (/home/yann/.ec2/testpoolparty) | |
0 running instances (1 - 1) | |
/usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:261:in `ec2_error?': The key pair 'testpoolparty' does not exist (EC2::InvalidKeyPairNotFound) | |
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:199:in `make_request' | |
from /usr/lib/ruby/1.8/net/http.rb:543:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:173:in `make_request' | |
from /usr/lib/ruby/gems/1.8/gems/grempe-amazon-ec2-0.3.8/lib/EC2.rb:224:in `response_generator' | |
from /usr/lib/rub |
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 | |
# | |
# Set our bash prompt according to the branch/status of the current git | |
# repository. | |
# | |
# Forked from http://gist.github.com/31967 | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" |
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
# >----------------------------[ Initial Setup ]------------------------------< | |
# generator initializer | |
initializer 'generators.rb', <<-RUBY | |
Rails.application.config.generators do |g| | |
end | |
RUBY | |
# say methods | |
def say_step(name); say "\033[36m" + 'step'.rjust(10) + "\033[0m" + " Running #{name} step..." 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
def multi_replace(string, *rules) | |
scanning_pattern = Regexp.union(rules.map{|e| e.first} | [/./]) | |
string.scan(scanning_pattern).map do |match| | |
rules.select{|e| match =~ e.first}.flatten.last || match | |
end.join | |
end | |
multi_replace("the first problem is not egal to second problem", [/first problem/, "older problem"], [/second problem/, "first problem"]) |
NewerOlder