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.
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
@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',
###
# Read in XML as a stream, write out JSON as a stream. As little information
# is kept in memory as possible.
require 'nokogiri'
require 'psych'
class JSONTranslator < Nokogiri::XML::SAX::Document
attr_reader :emitter
def initialize emitter
#!/bin/sh
new_tags_file="$TMPDIR/tags-$RANDOM"
ctags --tag-relative -Rf $new_tags_file --exclude=.git --languages=-javascript,sql
mv "$new_tags_file" .git/tags
@atmos
atmos / clean-merged-branches
Created January 5, 2012 08:28
clean-merged-branches
#!/bin/sh
#/ Usage: clean-merged-branches [-f]
#/ Delete merged branches from the origin remote.
#/
#/ Options:
#/ -f Really delete the branches. Without this branches are shown
#/ but nothing is deleted.
set -e
# show usage maybe
@justinko
justinko / post_creation_context.rb
Created January 9, 2012 22:38
The value of contexts in DCI
class PostCreationContext
def initialize(post)
@post = post
@post.extend PostNotifier
@post.extend PostIndexer
@post.extend PostCacher
end
def execute
@post.save