Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher redinger

View GitHub Profile
View keybase.md

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:

View gist:4698
class Rock
def play(previous="s")
"r"
end
def name
"RedingerRock"
end
end
View gist:6671
# 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.
View autoconf.rb
module Autoconf
extend self
def switches(config=nil)
case config
when String
switch(config)
when Enumerable
config.map {|item| switch(item) }.join(" ").strip
else
View 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'
View rack-noslashdot.rb
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
View generate_rails_app.rb
#!/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
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
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))