This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspen import auth | |
class MyUser(auth.BaseUser): | |
pass | |
auth.User = MyUser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === 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 === |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set showtabline=2 | |
nmap <C-S-tab> :tabprevious<cr> | |
nmap <C-tab> :tabnext<cr> | |
nmap <C-t> :tabnew<cr> | |
nmap <C-w> :tabclose<cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SETUP_NEW_TIPS_TO = """ | |
INSERT INTO tips (ctime, tipper, tippee, amount) | |
SELECT DISTINCT ON (tipper) | |
min(ctime), tipper, %s AS tippee, sum(amount) | |
FROM tips | |
WHERE tippee=%s OR tippee=%s | |
GROUP BY tipper, mtime | |
ORDER BY t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -u | |
import commands | |
import os | |
import random | |
import sys | |
import time | |
restart = '-s' in sys.argv | |
if restart: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "GitTip.com/UserL33T/PubFund1", | |
"link": { "rel": "self", "type": "application/atom+xml", "href": "http://gittip.com/UserL33T/PubFund1" }, | |
"updated": "20120930T180453Z", | |
"author": {"name": "UserL33T"}, | |
"title": "UserL33T's First Published Fund", | |
"description": "UserL33T's First Published Fund is a Project", | |
"units_type": "USD", | |
"entries": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var q = require('q'), | |
vm = require('vm'), | |
ctx = vm.createContext({setTimeout: setTimeout, console: console, end: q.defer()}), | |
script = vm.createScript("now = 1; setTimeout(function() { now = 2; console.log('Inside the VM: ' + now); end.resolve() }, 1000);"); | |
script.runInContext(ctx); | |
ctx.end.promise.then(function () { | |
console.log("Now process template with " + ctx.now); | |
}, 500); |