Skip to content

Instantly share code, notes, and snippets.

development:
adapter: postgresql
encoding: utf8
host: localhost
database: canvas_development
username: postgres
password: password
timeout: 5000
prefer_slave: true
slave:
##
# replaces :blah: with an image with the appropriate emoji
all_emojis = [
'+1', '-1', '100', '1234', '8ball', 'a', 'ab', 'abc', 'abcd', 'accept',
'aerial_tramway', 'airplane', 'alarm_clock', 'alien', 'ambulance', 'anchor',
'angel', 'anger', 'angry', 'anguished', 'ant', 'apple', 'aquarius', 'aries',
'arrow_backward', 'arrow_double_down', 'arrow_double_up', 'arrow_down',
'arrow_down_small', 'arrow_forward', 'arrow_heading_down',
'arrow_heading_up', 'arrow_left', 'arrow_lower_left', 'arrow_lower_right',
@codekitchen
codekitchen / gfm.rb
Created January 5, 2011 15:56 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
class Object
def send_chain(meths)
result = self
meths.each do |m|
return nil if result == nil
if result.respond_to?(m)
result = result.__send__(m)
elsif result.respond_to?(:[])
result = result[m]
else