Skip to content

Instantly share code, notes, and snippets.

View akahn's full-sized avatar

Alex Kahn akahn

View GitHub Profile
spaced about 2-3 hours apart.
1/2 cup quaker oats + hot water + a few drops of honey
5 egg whites
1/2 grapefruit
repeat next meal twice:
1 chicken breast
handful of broccoli w/ stems
half an avocado
We couldn’t find that file to show.
#!/bin/sh
dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost 127.0.0.1 "Arbitrary text record" &
PID=$!
ssh -C -N -L 3689:localhost:3689 user@host.dyndns.org
kill $PID
describe SomeClass do
freeze { 1.day.from_now }
it "does some stuff with time" do
end
end
# this actually does...
describe SomeClass do
before { Timecop.freeze(1.day.from_now) }

Smokey Fast Beer and Bacon BBQ Sauce (BBBBQ Sauce)

  • 1 Large Red Onion
  • 3 Garlic Cloves
  • 1 Cup, Heinz Ketchup
  • 1 or 2 strips of thick smoked bacon
  • 1/2 Bottle Schlenkerla Marzen (or other Smoked Lager)
  • 1/2 Cup Brown Sugar
  • 2 Tablespoons Adobo Sauce from Chipotles in Adobo
  • Olive Oil
@next2you
next2you / Postgres Index Usage.sql
Created October 15, 2010 20:12 — forked from sriedel/Postgres Index Usage
Postgres: Determine table/index size
SELECT idx.relname as table,
idx.indexrelname as index,
pg_relation_size( idx.indexrelname::text )/1024/1024 as bytes,
cls.relpages as pages,
cls.reltuples as tuples,
idx.idx_scan as scanned,
idx.idx_tup_read as read,
idx.idx_tup_fetch as fetched
FROM pg_stat_user_indexes idx,
pg_class cls ,
@paulirish
paulirish / gist:649992
Created October 27, 2010 21:04
store all twitter favorites in instapaper
$ = window.jQuery;
var html = '' +
' <form action="//www.instapaper.com/bookmarklet/post_v5" method="post" id="instapaper"> \
<input type="hidden" name="p" value=""/> \
<input type="hidden" name="b" id="b" value=""/> \
</form>';
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@thexodus
thexodus / gist:760735
Created December 31, 2010 04:53
linecache in ruby-1.9.2-head
gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head/
Emoji: {
'sunny': '2600',
'zap': '26a1',
'leaves': '1f343',
'lipstick': '1f483',
'cop': '1f46c',
'wheelchair': '267f',
'fish': '1f413',
'hammer': '1f52c',