Skip to content

Instantly share code, notes, and snippets.

View mcculloughsean's full-sized avatar

Sean McCullough mcculloughsean

  • Groupon
  • San Francisco, CA
View GitHub Profile
@mcculloughsean
mcculloughsean / NodeReadingList.md
Created September 3, 2012 01:28
Node Reading List
mod = require './module'
module.exports.drive = () ->
mod.doSomething() # returns `/default/path`
mod.path = '/something/else'
mod.doSomething() # returns `/something/else`
module.exports.drive()
☁ bulk-hogan [upgrade-hogan] npm show hogan
npm http GET https://registry.npmjs.org/hogan
npm http 304 https://registry.npmjs.org/hogan
{ name: 'hogan',
description: 'A mustache compiler.',
'dist-tags': { latest: '1.0.5-dev' },
versions: '1.0.5-dev',
maintainers: 'fractal <contact@wearefractal.com>',
time: { '1.0.5-dev': '2012-01-28T21:44:36.563Z' },
@mcculloughsean
mcculloughsean / graphit.coffee
Created April 20, 2012 03:09
Vector to Graph
_ = require('underscore')
assert = require('assert')
util = require('util')
vector = [
{ id: 1, value: 'aaa', parent: null},
{ id: 2, value: 'bbb', parent: null},
{ id: 3, value: 'ccc', parent: 2},
{ id: 4, value: 'ddd', parent: 2},
{ id: 5, value: 'eee', parent: 1},
{ id: 6, value: 'fff', parent: 4},
set guifont=Anonymous_Pro_Bold:h16
macmenu &File.New\ Tab key=<D-T>
set guioptions=egmrt
color molokai
map <D-M-Up> <C-w>k
imap <D-M-Up> <Esc> <C-w>k
map <D-M-Down> <C-w>j
imap <D-M-Down> <Esc> <C-w>j
map <D-M-Right> <C-w>l
imap <D-M-Right> <Esc> <C-w>l
@mcculloughsean
mcculloughsean / gist:2027012
Created March 13, 2012 05:30 — forked from remear/gist:1724911
Fixing Apachebench on OS X Lion
# If you're getting this error trying to use ApacheBench on OS X Lion:
# Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54)
#
# You need to download the latest beta version of Apache and rebuild ab.
# Here's how (assuming you have homebrew installed).
# Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support
brew install pcre
# Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it
@mcculloughsean
mcculloughsean / mongo_logger_patch.rb
Created October 19, 2011 06:26
Stack Trace for MongoDB Calls in Ruby Driver
#include this before you start your connection
#this will show where your app is triggering mongodb calls
# a modification of an ActiveRecord trace call by Stephen Celis
module Mongo
module Logging
def log_operation(name, payload)
@logger ||= nil
return unless @logger
msg = "#{payload[:database]}['#{payload[:collection]}'].#{name}("
@mcculloughsean
mcculloughsean / tracker_csv_export_to_pdf.rb
Created August 24, 2011 18:55 — forked from rheaton/tracker_csv_export_to_pdf.rb
takes a csv file from tracker and makes story cards. be careful of the order when you are cutting them up.
#!/usr/bin/env ruby
# Script to generate PDF cards suitable for planning poker
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export.
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png
require 'rubygems'
@mcculloughsean
mcculloughsean / decoder
Created May 27, 2011 16:36
Broken json
def base64_url_decode(str)
str = str + "=" * (6 - str.size % 6) unless str.size % 6 == 0
return Base64.decode64(str.tr("-_", "+/"))
end
@media all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: portrait) {#mainNav #economic-development,#mainNav #workforce,#mainNav #downtown-development, #mainNav #business-development, #mainNav #public-policy, #mainNav #partnership-newsroom {
padding: 0 4px 0 8px;
} } /* iPad Portrait */
@media all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: landscape) { #mainNav #economic-development,#mainNav #workforce,#mainNav #downtown-development, #mainNav #business-development, #mainNav #public-policy, #mainNav #partnership-newsroom {
padding: 0 4px 0 8px;
} } /* iPad Landscape */