Skip to content

Instantly share code, notes, and snippets.

# === configure-aspen.py ===
website.security.timeout = 86400
website.security.httpbasic.enabled = True
website.security.httpdigest.enabled = True
website.security.cookieauth.enabled = True
website.security.cookieauth.timeout = 86400 * 7
# === login / logout ===
@chadwhitacre
chadwhitacre / gist:4150456
Created November 26, 2012 20:36
configure-aspen.py for current aspen auth
from aspen import auth
class MyUser(auth.BaseUser):
pass
auth.User = MyUser
@chadwhitacre
chadwhitacre / tt.py
Created November 1, 2012 16:36
Time tracking script.
#!/usr/bin/env python
"""This script prints time tracking reports to stdout.
The program takes its configuration from ~/.ttrc, which is in INI format
with one section and two keys:
[main]
timesheet=~/.timesheet
timezone=US/Eastern
@chadwhitacre
chadwhitacre / gist:3940639
Created October 23, 2012 18:37
diff -ru master-02899 master-a805
diff -ru master-02899/.git/HEAD master-a805/.git/HEAD
--- master-02899/.git/HEAD 2012-10-23 14:35:41.000000000 -0400
+++ master-a805/.git/HEAD 2012-10-23 14:35:14.000000000 -0400
@@ -1 +1 @@
-02899c45e4eef039318c641bc70e477478b23740
+a805db2e43d8da3017b2da4c2e0db981b10c748c
Binary files master-02899/.git/index and master-a805/.git/index differ
diff -ru master-02899/.git/logs/HEAD master-a805/.git/logs/HEAD
--- master-02899/.git/logs/HEAD 2012-10-23 14:35:41.000000000 -0400
+++ master-a805/.git/logs/HEAD 2012-10-23 14:35:14.000000000 -0400
@chadwhitacre
chadwhitacre / gist:3902155
Created October 16, 2012 21:27
Testing with context managers
from gittip import testing
def test_inserting_inserts():
with testing.load() as context:
context.db.execute("INSERT INTO participants VALUES ('foo')")
actual = context.diff(compact=True)
@chadwhitacre
chadwhitacre / gist:3847159
Created October 7, 2012 05:00
Ramblings on gittip marketing strat

[A close friend of mine sent this to me via email.—whit537]

Here is the evaluation as promised/threatened:

What is gittip? How is gittip not just you? (Paying people out of pocket, pushing a personal goal of $2,000, writing essays about your inspirations.) How do other people resonate with gittip, beyond wanting free money from their posse?

The answer represents what gittip will become. It is your market / dedicated userbase, who will represent the drift of gittip, if indeed you want gittip to be run by them. (This is the same conversation we had about your lecture school project.)

I see dowski, thiloplans, and lyndsysimon on the forum... are you going after those people? Do you deal with them directly, outside of their services? Or are they just watching you run gittip & chiming in on your thought processes?

@chadwhitacre
chadwhitacre / find.py
Created October 3, 2012 23:45
Script for Saxifrage Class to Chew On
#!/usr/bin/env python
# The "import" statement finds modules (whatever those are!) and defines names
# in a namespace (whatever that is!):
#
# http://docs.python.org/reference/simple_stmts.html#the-import-statement
#
# The "sys" module provides things related (apparently) to the interpreter
# (whatever that is!):
#
@chadwhitacre
chadwhitacre / gist:3799912
Created September 28, 2012 13:39
Crutches for when you're stuck
=================
Don't Forget To
=================
0. Test often. Test after every little change.
1. Listen to music.
2. Drink coffee.
3. Do chores.
program = qs['program']
^L
Greetings, {{ program }}!
program = "python"
^L
Greetings, {{ program }}!