Skip to content

Instantly share code, notes, and snippets.

View hannahherbig's full-sized avatar

Hannah Herbig hannahherbig

View GitHub Profile
@hannahherbig
hannahherbig / clock.rb
Created December 4, 2011 03:02
polar clock in Shoes
def helper from_edge, number
twopi = Shoes::TWO_PI
angle1 = twopi / 4 * 3
angle2 = (angle1 + number * twopi) % twopi
width = @clock.width
radius = width - from_edge * 2
arc width / 2, width / 2, radius, radius, angle1, angle2
end
@hannahherbig
hannahherbig / merge.coffee
Created December 21, 2011 17:54
merge function
_ = require 'underscore'
# merge all the objects together into one
# e.g.
# merge({ one: 1, two: 5 }, { two: 2 })
# { one: 1, two: 2 }
merge = (objects...) ->
result = {}
for obj in objects
_(obj).each (value, key) ->
irc = require 'irc'
twitter = require 'ntwitter'
bot = new irc.Client 'irc.mcintec.net', 'node',
channels: ['#twitter']
twit = new twitter
consumer_key: ''
consumer_secret: ''
access_token_key: ''
@hannahherbig
hannahherbig / parse.coffee
Created December 22, 2011 23:10
irc parser
module.exports = parse = (str) ->
origin = null
command = null
args = []
# pull out the origin if there is one
if str[0] is ':'
i = str.indexOf ' '
origin = str.slice 1, i
str = str.slice i + 1
source :rubygems
gem 'foreman'
gem 'stalker'
gem 'clockwork'
%ul
%li dick1
%li dick2
@hannahherbig
hannahherbig / life.rb
Created April 20, 2012 05:49
conway's game of life
# conway's game of life
col = 50
row = 50
# set this up however you want, i like randomness.
env = col.times.map { row.times.map { 0 == rand(2) } }
loop do
puts "-" * col
shot() {
for file in "/Users/andrew/Desktop/Screen Shot"*
do
hash=`shasum $file | awk '{ print $1 }'`
new="$hash.png"
mv $file "/Users/andrew/Dropbox/Public/files/$hash.png"
echo "$file => http://dl.dropbox.com/u/5489165/files/$hash.png"
done
}
@hannahherbig
hannahherbig / gist:3164717
Created July 23, 2012 16:59
my autoexec.cfg for cs:s
cl_ragdoll_physics_enable 0
alias _voice_toggle _voice_on
alias _voice_on "alias _voice_toggle _voice_off; +voicerecord"
alias _voice_off "alias _voice_toggle _voice_on; -voicerecord"
alias _demo_pause_toggle _demo_pause_on
alias _demo_pause_on "alias _demo_pause_toggle _demo_pause_off; demo_pause"
alias _demo_pause_off "alias _demo_pause_toggle _demo_pause_on; demo_resume"
So recently the Louvre was rid of some of its most prized possessions. This brilliant thief managed to break in, remove several paintings, escape, and load them into his van without setting off a single alarm. Fortunately, the criminal was caught a few miles down the road, with his vehicle unable to move.
When the police questioned him about how he could mastermind a brilliant heist, yet forget to put fuel in his van, the thief responded, "You see, I did not have the Monet to buy Degas to make the Van Gogh."