Skip to content

Instantly share code, notes, and snippets.

View saimonmoore's full-sized avatar

Saimon Moore saimonmoore

View GitHub Profile
ejabberdctl ||= "/usr/local/sbin/ejabberdctl"
God.watch do |w|
w.name = "ejabberd"
w.interval = 30.seconds # default
w.start = "#{ejabberdctl} start"
w.stop = "#{ejabberdctl} stop"
w.restart = "#{ejabberdctl} restart"
alias hns="hack && ship"
config.after_initialize do
puts "[RAILS] Rails loaded successfully!"
unless Object.const_defined?(:IRB) || Object.const_defined?(:MY_DAEMON_CTL_STARTED) || Object.const_defined?(:MY_OTHER_DAEMON_CTL_STARTED) RAILS_ENV == 'test'
puts "[RAILS] Starting daemons..."
begin
MyDaemonController.instance.start
rescue ::DaemonController::AlreadyStarted => das
puts "MyDaemon already started..."
end
<?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>Disabled</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>net.process-one.Ejabberd2</string>
@saimonmoore
saimonmoore / git.rake
Created September 3, 2008 09:30 — forked from defunkt/gist:4169
# by bryan helmkamp with slight modification by chris wanstrath
# and a bit of refactoring by saimon moore
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
module GitCommands
extend self
def diff_staging
execute('git fetch')
puts `git diff origin/production origin/staging`
# god
# This service maintains a god (http://god.rubyforge.org/) instance from the point the system is
# started until it is shut down again.
start on runlevel 5
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6
# god
# This service maintains a god (http://god.rubyforge.org/) instance from the point the system is
# started until it is shut down again.
description "service god.rb"
author "Saimon Moore <saimon@webtypes.com>"
start on startup
stop on runlevel 0
function gchm() {
rake git:branch:checkout_with_migrations[$1]
}
function gchm() {
rake git:branch:checkout_with_migrations[$1]
}
FormBubbler = {
submittableInput: function(element) {
var element = $(element);
return ( element.match('input[type=text]') || element.match('input[type=password]') );
},
submitButton: function(element) {
var element = $(element);
return ( element.match('input[type=submit]') || element.match('input[type=image]') );
},