Skip to content

Instantly share code, notes, and snippets.


Christopher redinger

View GitHub Profile
View gist:4698
class Rock
def play(previous="s")
def name
View gist:6671
# Video:
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
View autoconf.rb
module Autoconf
extend self
def switches(config=nil)
case config
when String
when Enumerable {|item| switch(item) }.join(" ").strip
View god.rb
rails_root = "/data/github/current"
20.times do |num| do |w| = "dj-#{num}" = 'dj'
w.interval = 30.seconds
w.start = "rake -f #{rails_root}/Rakefile production jobs:work"
w.uid = 'git'
View rack-noslashdot.rb
class NoSlashdot
def initialize(app, options = {})
@app = app
@options = options
@options[:redirect] ||= ''
def call(env)
slashdot_sent_ya?(env) ? kick_it :
View generate_rails_app.rb
#!/usr/bin/env ruby
# Written by Kieran P
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
View gist:540518
ruby 1.8.7
>> [1, 88, 132, 78, 74].pack("C5")
=> "\001X\204NJ"
ruby 1.9.2
>> [1, 88, 132, 78, 74].pack("C5")
=> "\x01X\x84NJ"
redinger /
Created Nov 26, 2011
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Cocoa Emacs

Download the latest pretest version of [Emacs for Mac OS X]:

redinger / Datomic News Updates
Created Jul 22, 2012 — forked from stuarthalloway/Datomic News Updates
Datomic update examples against a social news database
View Datomic News Updates
;; Datomic example code
;; demonstrates various update scenarios, using a news database
;; that contains stories, users, and upvotes
;; grab an in memory database
(use '[datomic.api :only (q db) :as d])
(def uri "datomic:mem://foo")
(d/create-database uri)
(def conn (d/connect uri))