This file contains hidden or 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 | |
# drivethru - continuous deployment for chef | |
# June 2012 Jacob Elder <[email protected]> | |
require 'listen' | |
require 'net/ssh' | |
require 'smart_colored/extend' | |
node = ARGV[2] | |
abort("usage: knife exec drivethru.knife NODE") unless node |
This file contains hidden or 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 | |
function my_slow_job() { | |
sleep 1 | |
} | |
function parallel_demo() { | |
count=${1:-10} | |
echo "Starting $count parallel processes:" | |
for i in $(seq -w $count) ; do |
This file contains hidden or 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
If you can read this, your Twitter still loves GitHub Gists. |
This file contains hidden or 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 | |
def benchmark(count) | |
timing = [] | |
count.times do | |
start = Time.now | |
yield | |
timing << Time.now - start | |
print "." | |
end |
This file contains hidden or 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
[2012-07-25T15:22:50+00:00] INFO: Processing log[my message] action write (example::default line 5) | |
[2012-07-25T15:22:50+00:00] INFO: my message |
This file contains hidden or 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 -o nounset | |
set -o errtrace | |
set -o errexit | |
set -o pipefail | |
progname=$(basename $0) | |
default_name="Marley" |
This file contains hidden or 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
gem 'smart_colored', :require => 'smart_colored/extend' | |
gem 'rest-client' |
This file contains hidden or 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 'sinatra' | |
set :public_folder, Proc.new { File.dirname(__FILE__) } | |
get '/' do | |
File.read("index.html") | |
end |
This file contains hidden or 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
# This is an attempt at constructing an application which complies with the | |
# ideas expressed at http://www.12factor.net/, specifically section 3, "Config" | |
# which states that configuration parameters which vary between environments | |
# should be stored in environment variables. | |
# | |
# `Configuration` is a thin wrapper around Ruby's ENV hash which also allows | |
# traditional custom config parameters to be set. Add an `attr_accessor` line | |
# and define the value in `config/environments/*.rb`. | |
# | |
# For example, `Configuration.api_token` called in the foobar environment will |
This file contains hidden or 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 | |
# Wait for changes to a CoffeeScript file, compile it, and run it under either Mongo or Mac OS X's native JavaScript runtime. | |
set -o nounset | |
set -o errtrace | |
set -o errexit | |
set -o pipefail | |
usage() { | |
cat <<END |