Skip to content

Instantly share code, notes, and snippets.

View iamwilhelm's full-sized avatar

Wil Chung iamwilhelm

  • Mountain View, CA
View GitHub Profile
State,ZipCode,TaxRegionName,TaxRegionCode,CombinedRate,StateRate,CountyRate,CityRate,SpecialRate
CT,06001,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06002,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06006,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06010,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06011,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06013,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06016,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06018,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
CT,06019,CONNECTICUT STATE,AKUV,0.063500,0.063500,0,0,0
@iamwilhelm
iamwilhelm / default_args.coffee
Created September 1, 2012 04:42
Default arguments in javascript/coffeescript
# Here's a way to do default arguments in coffeescript with combinators
defaultArgs = (defaults...) ->
(callback) ->
(args...) ->
callback.apply @, ((arguments[i] || def) for i, def of defaults)
# However, coffeescript already supports default arguments, so if you translate it to javascript,
# it's a way to do default arguments
module rook_battlement(height, radius) {
neck_radius = radius;
battlement_radius = 1.4 * radius;
inner_battlement_radius = 0.6 * battlement_radius;
cylinder(0.2 * height, neck_radius, battlement_radius);
translate([0, 0, 0.2 * height]) {
difference() {
// the battlement
cylinder(0.8 * height, battlement_radius, battlement_radius);
module bishop_head(head_ratio, neck_radius) {
translate([0, 0, neck_radius])
difference() {
// the bishop head with a dollop on top
union() {
teardrop(head_ratio, neck_radius)
translate([0, 0, -neck_radius / 3]) sphere(neck_radius / 3);
}
// the bishop slot
@iamwilhelm
iamwilhelm / about.md
Created August 9, 2011 19:29 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@iamwilhelm
iamwilhelm / 0 sync.coffee
Created August 6, 2011 23:45
asynchronous flow control
app.post '/users/signup', (req, res) ->
crypted_password = User.generate_crypted_password req.body.user.password
user = User.findOne { "facebook.uid": req.body.uid }
if user
user.email = req.body.user.email
user.password = crypted_password
else
user = new User({ email: req.body.user.email, password: crypted_password })
user.save
req.session.regenerate
@iamwilhelm
iamwilhelm / screenlapse.sh
Created January 23, 2011 18:56
The poor man's screen lapse
#!/bin/sh
SCREENSHOT_PATH="/tmp/screenlapse/"
mkdir -p $SCREENSHOT_PATH
while true;
do
TIME=`date +-%Y-%m%d-%H%M%S`
screencapture -m $SCREENSHOT_PATH"sl"$TIME".png"
convert -resize 40% $SCREENSHOT_PATH"sl"$TIME".png" $SCREENSHOT_PATH"sl"$TIME".png"
@iamwilhelm
iamwilhelm / test unit autorun tests.rb
Created January 21, 2011 20:47
how unit test files automatically run
##
# Registers MiniTest::Unit to run tests at process exit
def self.autorun
at_exit {
next if $! # don't run if there was an exception
exit_code = MiniTest::Unit.new.run(ARGV)
exit false if exit_code && exit_code != 0
} unless @@installed_at_exit
@@installed_at_exit = true
[INFO] Closing DB : mindless_production
[DEBUG] KROLL GET PROPERTY: close=[object TiDatabase]->close: [2]
[DEBUG] KROLL GET PROPERTY: API=<KrollObject: 0x7a9fcd0>
[DEBUG] KROLL GET PROPERTY: info=[object APIModule]->info: [2]
[INFO] Closed dbc connection
[DEBUG] KROLL GET PROPERTY: App=<KrollObject: 0x7a99b50>
[DEBUG] KROLL GET PROPERTY: fireEvent=Remember the people that you meet->fireEvent: [2]
[DEBUG] fire app event: showIndicator with {
message = "Deleting unsynced";
}
Process: mindless [95939]
Path: /Users/iamwil/Library/Application Support/iPhone Simulator/4.0.2/Applications/53071FAE-7C99-484E-ACB8-90CFE853CDC7/mindless.app/mindless
Identifier: mindless
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [151]
Date/Time: 2010-10-20 14:27:26.891 -0700
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6