Skip to content

Instantly share code, notes, and snippets.

View john-griffin's full-sized avatar

John Griffin john-griffin

View GitHub Profile
@deepak
deepak / Dockerfile
Created July 5, 2013 06:59
Dockerfile to install ruby using brightbox deb
# DOCKER-VERSION 0.4.8
FROM ubuntu:12.04
MAINTAINER Deepak Kannan "deepak@codemancers.com"
RUN apt-get -y install python-software-properties
RUN apt-add-repository -y ppa:brightbox/ruby-ng-experimental
RUN apt-get -y update
@ABrambleNinja
ABrambleNinja / open_uri.rb
Last active December 18, 2015 22:39 — forked from zaius/open_uri.rb
# Allow open-uri to follow unsafe redirects (i.e. https to http).
# Relevant issue:
# http://redmine.ruby-lang.org/issues/3719
# Source here:
# https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb
module OpenURI
class <<self
alias_method :open_uri_original, :open_uri
alias_method :redirectable_cautious?, :redirectable?
@eprothro
eprothro / shards.yml
Created April 12, 2013 19:28
Dynamic Octopus configuration for master/slave horizontal DB scaling with a Rails application on the Heroku stack. See the wiki page for more info: https://github.com/tchandy/octopus/wiki/Replication-with-Rails-on-Heroku. Props to Heroku for the idea, gleaned from the dynamic database.yml they inject at build-time for rails apps.
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else
@olivierlacan
olivierlacan / rails_default_diff.sh
Created July 7, 2012 20:31
Track changes to a skeleton Rails app since a given version
#!/usr/bin/env zsh
# -------------------------------------------------------------------------------- #
# 1304046900 Track changes to a skeleton Rails app since a given `base_version`
# -------------------------------------------------------------------------------- #
## Changelog
# - Update 7/7/2012:
# * rewrote to use Bundler instead of RubyGems
# * attempting to switch to a master branch for which no commit existing was causing a pathspec error
# * simplified rails new commands by running them on the current path (after changing directory to tmp/skeleton_check of course).
# * renamed `old_version` variable to `base_version` for clarity
Viz.WidgetsController = Ember.ArrayController.extend
init: ->
@refresh()
setInterval (=> @refresh), 5000
refresh: ->
$.ajax
url: @get('src'),
type: "GET",
context: this,
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ldunn
ldunn / gist:1526376
Created December 28, 2011 04:52
Cards Against Humanity (black)
_? There's an app for that
Why can't I sleep at night? _
What's that smell? _
I got 99 problems but _ ain't one.
Who stole the cookies from the cookie jar? _
What's the next Happy Meal (r) toy? _
Anthropologists have recently discovered a primitive tribe that worships _.
It's a pity that kids these days are all getting involved with _.
During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of _.
Alternative medicine is now embracing the curative powers of _.
@ldunn
ldunn / gist:1526304
Created December 28, 2011 04:38
Cards Against Humanity (white)
Coat hanger abortions
Man meat
Autocannibalism
Vigorous jazz hands
Flightless birds
Pictures of boobs
Doing the right thing
Hunting accidents
A cartoon camel enjoying the smooth, refreshing taste of a cigarette
The violation of our most basic human rights
require "money"
class Decorator < BasicObject
undef_method :==
def initialize(component)
@component = component
end
def method_missing(name, *args, &block)
@dkubb
dkubb / .gitignore
Created December 5, 2011 18:26
Test Feedzirra w/VCR using an HTTP proxy
cassettes