Skip to content

Instantly share code, notes, and snippets.

View akahn's full-sized avatar

Alex Kahn akahn

View GitHub Profile
@akahn
akahn / output
Created July 9, 2011 00:33 — forked from bkeepers/output
$ ruby serialization.rb
Sizes:
marshal: 55
msgpack: 35
json: 46
Rehearsal -----------------------------------------------------
marshal 1.590000 0.050000 1.640000 ( 1.647142)
json 1.890000 0.200000 2.090000 ( 2.091030)
marshal with yajl 1.590000 0.030000 1.620000 ( 1.624589)
json with yajl 1.860000 0.060000 1.920000 ( 1.926875)
@akahn
akahn / a-screenshot.md
Created February 10, 2011 17:25 — forked from tmm1/README.md
Embed gravatars in Propane chat

#!/usr/bin/env ruby
require 'highline/system_extensions'
include HighLine::SystemExtensions
module Standup
module Control
extend self
def play
function select_towns(towns) {
var options = $('#search_town_data option');
towns.split(',').each(function(town_id_string) {
options.has('[value='+ town_id_string +']').attr('selected', 'selected');
});
}
class Post < ActiveRecord::Base
has_many :authors
attr_accessor :post_authors
memoize :post_authors
def post_authors
process_post_authors
@import __base.sass
@import compass
$zen_first_sidebar_width: $zen_blueprint_left_units * $blueprint_grid_outer_width
$zen_second_sidebar_width: $zen_blueprint_right_units * $blueprint_grid_outer_width
$zen_content_width: $zen_blueprint_content_units * $blueprint_grid_outer_width - $blueprint_grid_margin
$zen_gutter: $blueprint_grid_margin
$zen_navbar_height: 40px
$zen_page_width: $zen_first_sidebar_width + $zen_content_width + $zen_second_sidebar_width
# Match subdomain for a Sinatra route
# cz.application.local:4567 => 200 0K
# en.application.local:4567 => 404 Not Found
# In your /etc/hosts:
# 127.0.0.1 cz.application.local
# 127.0.0.1 en.application.local
require 'rubygems'
@akahn
akahn / carbon.md
Created November 5, 2009 21:09 — forked from defunkt/carbon.md

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

module Ahoy
def self.included(base)
base.public_instance_methods.select {|m| m.to_s =~ /ar/ }.each do |method_name|
base.class_eval("alias #{method_name.gsub("ar", "arrr")} #{method_name}")
end
end
end
color ir_black " my favorite stock colorscheme is desert
set autochdir
syntax on
set hlsearch
set wildmenu
set wildmode=longest:full
set incsearch
filetype plugin on
set ruler
set laststatus=2