Skip to content

Instantly share code, notes, and snippets.

_ = require 'underscore'
module.exports = (robot) ->
class Leaderboard
constructor: ->
robot.brain.once 'loaded', =>
robot.brain.data.leaderboard ?= {}
@games = robot.brain.data.leaderboard.games ?= []
addGame: (winner, loser) ->
@games.push
@zacstewart
zacstewart / gfm.rb
Created April 23, 2012 21:35
GitHub Flavored Markdown (Ruby 1.9 compatible)
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
@zacstewart
zacstewart / .gitignore
Created August 21, 2011 15:33
My .vimrc
.VimballRecord
.netrwhist
.swp/
gvimrc
vimrc
@zacstewart
zacstewart / about.md
Created August 9, 2011 18:08 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@zacstewart
zacstewart / deploy.rb
Created July 4, 2011 17:41 — forked from uhlenbrock/deploy.rb
Simple Capistrano recipe for Jekyll with Pygments and Compass
set :application, 'zacstewart.com'
set :repository, '[email protected]:zacstewart/zacstewart.com.git'
set :scm, :git
set :deploy_via, :copy
set :branch, "master"
set :copy_compression, :gzip
set :use_sudo, false
set :host, 'zacstewart.com'
role :web, host