Skip to content

Instantly share code, notes, and snippets.

View redinger's full-sized avatar

Chris Redinger redinger

View GitHub Profile
What a crazy random happenstance.

Keybase proof

I hereby claim:

  • I am redinger on github.
  • I am redinger (https://keybase.io/redinger) on keybase.
  • I have a public key whose fingerprint is 52A9 21CD DE17 90B7 450C C155 C17B 31DE DC63 A669

To claim this, I am signing this object:

class Rock
def play(previous="s")
"r"
end
def name
"RedingerRock"
end
end
@redinger
redinger / gist:6671
Created August 21, 2008 23:44 — forked from defunkt/gist:6443
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
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
keynote-y.
module Autoconf
extend self
def switches(config=nil)
case config
when String
switch(config)
when Enumerable
config.map {|item| switch(item) }.join(" ").strip
else
@redinger
redinger / god.rb
Created July 21, 2009 14:48 — forked from defunkt/god.rb
rails_root = "/data/github/current"
20.times do |num|
God.watch do |w|
w.name = "dj-#{num}"
w.group = 'dj'
w.interval = 30.seconds
w.start = "rake -f #{rails_root}/Rakefile production jobs:work"
w.uid = 'git'
class NoSlashdot
def initialize(app, options = {})
@app = app
@options = options
@options[:redirect] ||= 'http://slashdot.org'
end
def call(env)
slashdot_sent_ya?(env) ? kick_it : @app.call(env)
end
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
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
redinger / Datomic News Updates
Created July 22, 2012 19:49 — forked from stuarthalloway/Datomic News Updates
Datomic update examples against a social news database
;; 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))