Skip to content

Instantly share code, notes, and snippets.

View nelsonjchen's full-sized avatar

Nelson Chen nelsonjchen

View GitHub Profile
@nelsonjchen
nelsonjchen / pizza.rb
Created October 18, 2012 05:12 — forked from jroesch/pizza.hs
ACM Micro-Challenge 1
require "test/unit"
# Write a function called numPizzas, that takes the number of people present,
# the number of slices in a pizza, and the time of day, and returns the
# number of pizzas to buy (as a whole integer).
#
# Spec:
# Signature: int numPizzas(int numPeople, int slicesPerPizza, int time)
# Time is an int on 24-hour clock (0-23), e.g. 8 = 8am, 14 = 2pm
# 11 = 11am 11pm = 23

Signing SCALE 11 stuff notes

Sending your signature

Install gpg from wherever. OS X: brew install gpg

Download the keyring from the email to ~/Desktop/

cd ~/Desktop && wget http://www.phildev.net/scale/scale11x-keyring.gpg
11670743
9887C3AA
8086060F
FF02EE69
BD0EEB0D
5BF8E747
6D263974
7AE3FCAD
720E900A
6EF31CD1
@nelsonjchen
nelsonjchen / progress-dump.sh
Created April 5, 2013 17:45
just reminding me how to rsync with bw limits
rsync -avzP -e ssh --progress --bwlimit=$1 nelson-data-dump dreambroker@mindflakes.com:~/dump/
Django==1.2.1
GraphiteReporter==0.1.4
PIL==1.1.7
Pygments==1.5
amqp==1.0.8
anyjson==0.3.3
argparse==1.2.1
bpython==0.11
importlib==1.0.2
kombu==2.5.6
[19:48:25] <cinnamyn77> it turned out my issue wasn't directly related to pycharm
[19:49:06] <cinnamyn77> though i am still slightly mystified that sys.modules had different directory capitalizations in pycharm and on the cli
[19:52:39] <crazysim> oh?
[19:52:58] <crazysim> what was it
[19:54:54] <cinnamyn77> deep in the test loaders in nose, it does some module checking
[19:55:16] <cinnamyn77> it was comparing the result of os.getcwd() to sys.modules
[19:55:25] <cinnamyn77> one had my home dir with my name capitalized, and one did not
[19:55:30] <crazysim> hmm
[19:55:36] <cinnamyn77> so the comparison failed, the modules were stripped out, and imports failed
[19:55:52] <cinnamyn77> i ended up renaming my homedir to be capitalized ><
#
# Cookbook Name:: nanoc-compass-overflow-demo
# Recipe:: default
#
# Copyright (C) 2013 YOUR_NAME
#
# All rights reserved - Do Not Redistribute
#
bash 'demo_bundler' do
import pycurl
class Response(object):
""" utility class to collect the response """
def __init__(self):
self.chunks = []
def callback(self, chunk):
self.chunks.append(chunk)
def content(self):
return ''.join(self.chunks)
import pycurl
class Response(object):
""" utility class to collect the response """
def __init__(self):
self.chunks = []
def callback(self, chunk):
self.chunks.append(chunk)
def content(self):
return ''.join(self.chunks)
#
# Place this code to your .profile, .bashrc, .bash_profile or whatever
#
program_exists () {
type "$1" &> /dev/null ;
}
if program_exists go; then