This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: postgresql | |
encoding: utf8 | |
host: localhost | |
database: canvas_development | |
username: postgres | |
password: password | |
timeout: 5000 | |
prefer_slave: true | |
slave: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |