Skip to content

Instantly share code, notes, and snippets.

View john-griffin's full-sized avatar

John Griffin john-griffin

View GitHub Profile
@kylefinley
kylefinley / main.coffee
Created November 21, 2011 11:47
SproutCore 20 Routing + Statechart
require 'sproutcore'
require 'sproutcore-statechart'
require 'sproutcore-routing'
App = SC.Application.create()
App.GlobalNavController = SC.Object.create(
home: -> App.statechart.gotoState 'home'
about: -> App.statechart.gotoState 'about'
)
@mudge
mudge / canteen.coffee
Created October 31, 2011 23:05
A Hubot script to find out what is being served at the canteen today.
# Display what is for lunch today at the Macmillan canteen
#
# what's for lunch? - Returns the lunch options at the canteen today
jsdom = require 'jsdom'
formatOptions = (options) ->
options.replace(/(Veggie )?Main Course/, "").replace(/[\n\r]+/g, " ").trim()
module.exports = (robot) ->
@mrrooijen
mrrooijen / deploy.rb
Created June 26, 2011 02:37
Capistrano with Foreman Capfile
# encoding: utf-8
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
set :application, "hirefireapp"
set :repository, "git@codeplane.com:meskyanichi/myapp.git"
set :branch, "develop"
set :rvm_ruby_string, "1.9.2"
@czottmann
czottmann / Procfile
Created June 15, 2011 13:43
Example of a Foreman/Capistrano/upstart setup
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@beef
beef / Gemfile
Created December 15, 2010 11:29
Production environment for Rails 3 on heroku with rack-cache
# Add this to your gem file
group :production do
gem 'dalli'
gem 'rack-cache', :require => 'rack/cache'
gem 'rack-contrib', :require => 'rack/contrib'
end