Skip to content

Instantly share code, notes, and snippets.

Greetings, program!
@chadwhitacre
chadwhitacre / gist:3783013
Created September 25, 2012 16:36
example that should(?) work but doesn't
class Counter(object):
visitors = 0
counter = Counter()
^L
counter.visitors += 1
^L
howdy, visitor number {{ visitors }} !
@chadwhitacre
chadwhitacre / twit537.py
Created September 21, 2012 17:00
Simple Twitter archiving script in Python
#!/usr/bin/env python
import twitter
import simplejson
api = twitter.Api( consumer_key=''
, consumer_secret=''
, access_token_key=''
, access_token_secret=''
)
@chadwhitacre
chadwhitacre / gist:3651197
Created September 6, 2012 04:21
Arranging 100 Symbols

Last night I had my first experience teaching programming to beginners. The students had read the first three sections of the HTML 4 specification, and during the class session we installed a text editor and web browser, and started building web pages from scratch.

Based on the questions they asked and the discussion we had, I decided that it might help to zoom out a level and frame the concept of “programming” in general terms. This is what I came up with.


Computers are a tool to extend our power of reason.

Reason can be thought of as a processing of symbols according to rules.

@chadwhitacre
chadwhitacre / gist:3625032
Created September 4, 2012 18:59
Testing Public Gists

Testing public gists.

@chadwhitacre
chadwhitacre / gist:3620922
Created September 4, 2012 12:55
We Need an Open *Economist*

A friend of mine recently started publishing on Svbtle, a super-classy, invite-only blogging platform. I like the super-classy part, not so much the invite-only part. Can we have classy and open?

The Promise of Svbtle

The only way I get to see Svbtle's editing interface is when its creator, Dustin Curtis, deigns to show me. Turns out I love it. It feels like Apple to me. And like Apple, Svbtle whiffs of totalitarianism. Are these two traits, high quality and crushing control, inseparable? From Dustin:

I’ve decided to open [Svbtle] up to a small number of vetted bloggers. At least at first. The goal is simple: when you see the Svbtle design, you should know that the content is guaranteed to be great.

When I see the Svbtle design, I think, "Gee, I wish I were part of this elite club." If it were really about the content, Svbtle would be more like The Economist. It would [downplay the identity](http://www.quora.com/The-Economist/Will-The-Econ

@chadwhitacre
chadwhitacre / gist:3593759
Created September 2, 2012 02:00
On Jamming One's Personal Brand

I studied Greek in college, which meant I was temping soon after. My best gig was in an internal medicine office, where I sat in a closet calling insurance companies all day, and the ladies teased me for being a virgin, and also thought I was quaintly cute. Two of them attended my wedding.

In the closet, while calling the insurance companies, I stared at an old DOS medical records system. Each screen was a different human, a person, reduced to an ASCII medical records profile along familiar axes: name, age, gender, race, and then medical history. By the end of my stint I had an image of a reconstituted person, a human, appear (to my conscious mind) instantly upon switching screens. This was late 1999, the age of The Matrix, and I identified with Mouse, the geeky young character who scans the falling green characters and cognizes the world itself. Martha Schwartz, old lady, 309 lbs., sitting on her couch with a walker in front of her, tube

from datadirect.dataset.aggregation_mixin import AggregationMixin
def test_aggregation_mixin_is_instantiable():
actual = AggregationMixin().__class__
assert actual is AggregationMixin, actual
"""Used when a person needed to go to Balanced to verify their merchant details
they are redirected here after the fact.
"""
from aspen import Response
from gittip import billing
#=========================================================================== ^L
if user.ANON:
raise Response(404)
"""Used when a person needed to go to Balanced to verify their merchant details
they are redirected here after the fact.
"""
from aspen import Response
from gittip import billing
#=========================================================================== ^L
if user.ANON:
raise Response(404)