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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.github.jasf.beamoff</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/beamoff.app/Contents/MacOS/beamoff</string> | |
</array> |
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 | |
loop { | |
begin | |
begin | |
exit 1 | |
ensure | |
p $! | |
raise "foo" | |
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 | |
require "excon" | |
require "active_support" | |
require "active_support/subscriber" | |
# Translates excon instrumentation events into rails style with | |
# namespace last. Yuck! | |
class ExconToRailsInstrumentor | |
def self.instrument(name, datum, &block) |
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 | |
require 'excon' | |
require 'json' | |
module EnumerableEnumerator | |
def self.included(base) | |
base.extend ClassMethods |
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
require 'fog' | |
class BackoffWhenThrottled < Excon::Middleware::Base | |
def error_call(datum) | |
datum[:throttle] ||= {} | |
datum[:throttle][:max_retries] ||= 0 | |
datum[:throttle][:max_delay] ||= 30 | |
datum[:throttle][:retry_count] = 0 | |
if throttled?(datum) |
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
$ cat cloud-init_0.7.5/etc/cloud/cloud.cfg | |
# The top level settings are used as module | |
# and system configuration. | |
# A set of users which may be applied and/or used by various modules | |
# when a 'default' entry is found it will reference the 'default_user' | |
# from the distro configuration specified below | |
users: | |
- default |
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
require 'sinatra' | |
require 'rack-test-ext' | |
configure :production do | |
use Rack::SSL | |
Rack::Test::Session.custom_env['HTTPS'] = 'on' | |
end | |
assets do | |
css :application, [ '/css/app.css' ] |
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 | |
require 'optparse' | |
require 'excon' | |
require 'json' | |
require 'uri' | |
require 'netrc' | |
class LibratoLogsUriFetcher | |
attr_reader :name, :user, :secret |
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
$ time be ruby -e 'puts "Hello World"' | |
Hello World | |
bundle exec ruby -e 'puts "Hello World"' 0.51s user 0.06s system 93% cpu 0.613 total | |
$ ruby --version | |
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.5.0] | |
$ time be ruby -e 'puts "Hello World"' | |
Hello World | |
bundle exec ruby -e 'puts "Hello World"' 12.71s user 0.40s system 183% cpu 7.132 total | |
$ ruby --version |
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 | |
require 'socket' | |
require 'net/https' | |
require "uri" | |
# Pings all addresses of an ELB every INTERVAL | |
interval = (ARGV[0] || 1).to_f | |
elb_name = ARGV[1] |