Skip to content

Instantly share code, notes, and snippets.

View emckean's full-sized avatar
💭
have I told you about Wordnik?

Erin McKean emckean

💭
have I told you about Wordnik?
View GitHub Profile
@sleepingkingstudios
sleepingkingstudios / gist:955676
Created May 4, 2011 18:05
Adding a :redcarpet Haml Filter to Rails
# Thanks to:
# http://stackoverflow.com/questions/1921777/how-to-write-a-haml-custom-filter
# config/initializers/haml_filters.rb
require 'haml/filters/redcarpet'
# lib/haml/filters/redcarpet.rb
require 'redcarpet'
module Haml::Filters::Redcarpet
@zeke
zeke / git_workflow.sh
Created November 9, 2011 20:44
git_workflow.sh
# (Assuming master is your main branch)
# To create a local branch
git checkout -b experiment
# To push a local branch to remote
git push origin experiment
# To check out an *existing* remote branch
# (In earlier versions, you needed an explicit --track option, but now it's the default when branching off a remote branch)
@zeke
zeke / example_results.txt
Created January 3, 2012 03:56
Fetch top Wordnik lookups from the past six weeks using the garb gem.
Top Lookups, 1 week(s) ago
diaphanous 4251
exigent 3358
fervid 3326
stolid 3037
interdict 2941
undulate 2536
depose 2276
disclose 1647
subterfuge 1223
@zeke
zeke / coffeescript_bundle_for_sublime.sh
Created March 1, 2012 22:39
Install the CoffeeScript TextMate bundle in Sublime Text 2
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Syntaxes/CoffeeScript.tmLanguage
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Preferences/CoffeeScript.tmPreferences
@colinpollock
colinpollock / Friday_Shots.md
Created March 23, 2012 18:35
Rules and regulations for Friday Shots

Friday Shots

Rules

  1. The competition begins every Friday promptly at beer o'clock (once at least one person has opened a beer and it is 4:00pm or later).
  2. Anyone in the office at the time of the competition can participate.
  3. No practice shots can be taken once the competition begins.
  4. Each participant gets to take one shot after paying the $1 entry fee. All fees must be paid
    prior to the first shot.
@srinivasmohan
srinivasmohan / hipchat_notify.rb
Created April 19, 2012 05:32
Post Nagios alerts to Hipchat
#!/usr/bin/ruby
require 'rubygems'
require 'hipchat-api'
require 'getopt/long'
require 'socket'
require 'erb'
#Do not modify these constants! (after you set these up, of course)
HipApiKey='ABCDEFGHKJHKJHKJHKJH'
Room='Nagios'
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@glenjamin
glenjamin / app.js
Created July 8, 2012 13:22
Express 3.0 flash messages with view helper
app.use(require('connect-flash')());
// Expose the flash function to the view layer
app.use(function(req, res, next) {
res.locals.flash = function() { return req.flash() };
next();
})
@stew
stew / kleisliexample.scala
Created January 16, 2013 14:07
example of kleisli in kleisli
import scalaz._
import Scalaz._
case class Person(name: String, score: Int)
object Main extends App {
type Environment = Map[String, Person]
type EnvReader[+A] = Kleisli[Option,Environment,A]
type UserReader[+A] = Kleisli[EnvReader,String,A]