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 Publishers | |
class HTTP | |
attr_accessor :key | |
attr_reader :hosts | |
def initialize attributes = nil | |
attributes ||= {} | |
self.event = attributes[:event] | |
self.hosts = attributes.fetch(:hosts) do |
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
[github] | |
user = coop | |
[user] | |
name = Tim Cooper | |
email = [email protected] | |
[alias] | |
c = commit -v | |
co = checkout | |
put = push origin HEAD | |
s = status --short |
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 API | |
module Private | |
class IncomingController < ApplicationController | |
attr_writer :payload | |
respond_to :json | |
def receive | |
key = payload.keys.first | |
object = {'charity' => Charity}.fetch(key).new payload[key] |
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
client = Client.new RedisWhere.new | |
client.track event | |
class RedisWhere | |
def name | |
'redis' | |
end | |
def track message | |
$redis.rpush *message |
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
namespace :app do | |
desc <<-DESC | |
Change application permissions. | |
Because the user deploying the application is different to the user | |
running the application we need to ensure that the permissions on | |
directories are what we expect. | |
DESC | |
task :permissions do | |
run "chown -R #{user}:www-data #{latest_release}" |
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
core: 'http://localhost:3000' | |
heroix: 'http://localhost:3001' | |
admin: 'http://localhost:3002' | |
passport: 'http://localhost:3003' | |
fundraiser: 'http://localhost:3004' | |
financials: 'http://localhost:3005' | |
recruitment: 'http://localhost:3006' |
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 | |
fork do | |
Process.setsid | |
exit if fork | |
if File.exists?('/path/to/pid.pid') | |
puts 'Pidfile already exists, not starting.' | |
exit 1 | |
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
#!/bin/sh | |
if ! [ `which brew` > /dev/null ]; then | |
echo "Installing Homebrew" >&2 | |
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" | |
fi | |
PACKAGES=( redis memcached rabbitmq mysql imagemagick ) | |
for PACKAGE in ${PACKAGES[@]} | |
do |
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
App = Ember.Application.create() | |
App.store = DS.Store.create({ | |
revision: 4, | |
adapter: DS.RESTAdapter.create({bulkCommit: false}) | |
}); | |
App.User = DS.Model.extend({ | |
name: DS.attr('string'), | |
email: DS.attr('string') | |
}) |