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
{ | |
"levels": [ | |
{ | |
"level_num": 1, | |
"plant_type": 0, | |
"color_scheme": 0, | |
"num_waves": 3, | |
"waves": [ | |
{ | |
"wave_num": 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
#!/usr/bin/env ruby | |
require 'aws/s3' | |
class S3Cmd | |
include AWS::S3 | |
def initialize | |
Base.establish_connection!( | |
:access_key_id => ENV['AWS_ACCESS_KEY_ID'], |
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 | |
usage = "pgurl <url> <command>" | |
url = ARGV.shift or abort usage | |
cmd = ARGV.shift or abort usage | |
require 'uri' | |
u = URI.parse(url) |
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 Heroku | |
class StaticAssetsMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# call returns an array containing [response code, header, Rack::Response] | |
reply = @app.call(env) |
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 node | |
var sys = require('sys') | |
var net = require('net') | |
var child_process = require('child_process') | |
if (!process.env.PORT) { | |
sys.puts('Must specify PORT') | |
process.exit() | |
} |
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
localhost'; | |
var PORT = 9999; | |
var Buffer = require('buffer').Buffer, | |
dgram = require("dgram"); | |
var client = dgram.createSocket(); | |
var buf = new Buffer(4); | |
buf.write('PING'); |
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 'system_timer' | |
require 'uri' | |
bad_url = 'postgres://some:[email protected]/mydb' | |
good_url = 'postgres://postgres@localhost/template1' | |
uri = URI.parse(good_url) | |
success = nil |
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 'system_timer' | |
host = '1.2.3.4' | |
SystemTimer.timeout(1) do | |
begin | |
result = `psql -h #{host} -c 'select 1'` | |
puts "server is up" | |
rescue Timeout::Error | |
puts "server is down" |
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
foreman run [PSTYPE] [--screen,-s] [--procfile,-p FILENAME] | |
foreman export FORMAT(inittab,upstart) [--app,-a APP] [--output,-o FILE_OR_PATH] [--procfile,-p FILENAME] [PSTYPE=CONCURRENCY,...] |
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 'aws/s3' | |
usage = "#{$0} <file> <bucket> [<access>]" | |
abort(usage) unless fname = ARGV.shift | |
abort(usage) unless bucket = ARGV.shift | |
access = ARGV.shift || 'private' | |
include AWS::S3 |