These are some useful git commands for implementing this in your own deployment setup.
Detecting if we're running on a clean checkout:
- git fetch
- git diff --shortstat [branch]
Determining if there are pending migrations:
class Mydrive < RTanque::Bot::Brain | |
NAME = 'mydrive' | |
include RTanque::Bot::BrainHelper | |
CORNERS = [:NW, :NE, :SE, :SW] | |
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 1.0 | |
def tick! | |
self.hide_in_corners | |
if (target = self.acquire_target) |
#!/usr/bin/env ruby | |
COLUMNS_TO_USE = 40.0 | |
histo = [] | |
0.upto(9) { |i| histo[i] = 0 } | |
field_to_parse = ARGV.shift.to_i | |
ARGF.each do |line| | |
fields = line.split(/,/) |
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations) | |
# By Peter Cooper | |
# Ruby 1.8.7/MagLev version by Karl Matthias | |
# | |
# MIT license | |
# | |
# * Not advised to use in your production environment! ;-) | |
# * Supports A and CNAME records | |
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance | |
# * All records get the same TTL |
class CaptureIO | |
# Coffeescript port of: https://gist.github.com/729616 | |
# | |
# Usage: | |
# test = new CaptureIO() | |
# unhook = test.hookStdout((string, encoding, fd) -> | |
# util.debug('stdout: ' + util.inspect(string)) | |
# ) | |
# Restoring stdout: |
Host * | |
ServerAliveInterval 10 | |
ServerAliveCountMax 600 |
Host * | |
ForwardAgent yes | |
ProxyCommand ~/bin/ssh-proxy.sh %h %p username@jump-host | |
ServerAliveInterval 10 | |
ServerAliveCountMax 600 |
class CompressedRequests | |
def initialize(app) | |
@app = app | |
end | |
def method_handled?(env) | |
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/) | |
end | |
def encoding_handled?(env) |