Skip to content

Instantly share code, notes, and snippets.

View digitalhobbit's full-sized avatar

Mirko Froehlich digitalhobbit

View GitHub Profile
# Based on example from <http://railscasts.com/episodes/130-monitoring-with-god>
# Use static root, as we're currently not reloading God config during deployments
APP_ROOT = '/var/www/twatcher/current'
APP_ENV = 'production'
def generic_monitoring(w, options = {})
w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 10.seconds
@implementation BackgroundLayer
@synthesize map; // the TMXTiledMap
@synthesize layer; // convenience property for layer, since we need to access this a lot
- (void)clearMap {
for (int x = 0; x < 30; x++) {
for (int y = 0; y < 20; y++) {
[self.layer setTileGID:1 at:ccp(x, y)];
}
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
# This is a bit hacky, but we don't have a clean way to hook into the parsed
# options, as Daemons is managing these internally.
number = 0
for i in 0..ARGV.length
if ARGV[i] == '--number'
number = ARGV[i + 1]
# If we ever end up running God / Starling on other environments than production.
# we'll have to find a different way to set the values below.
STARLING_PORT = 15151
STARLING_HOST = '<my ip address>'
RAILS_ENV = 'production'
# Based on example from <http://railscasts.com/episodes/130-monitoring-with-god>
RAILS_ROOT = '/var/www/myapp'