This file contains hidden or 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 | |
# | |
# An overly-strict multipart-MIME parser thingy. Works for my contrived | |
# examples, at least. Does things in a streaming fashion so you can deal with | |
# large (multi-GB) multipart MIME messages without using all your memory. | |
import email.parser | |
import pprint | |
import random | |
import sys |
This file contains hidden or 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
#define do main() /* | |
# This is a valid program in C, Perl, and sh. | |
eval 'function sub() { echo "I like code."; exit; }'; | |
sub echo {} | |
#*/ | |
do { | |
printf("I like code.\n"); | |
} |
This file contains hidden or 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 | |
import httplib | |
import time | |
conn = httplib.HTTPConnection('localhost', '6020') | |
conn.putrequest('PUT', '/sdb2/831/AUTH_test/c/o') | |
conn.putheader('Transfer-Encoding', 'chunked') | |
conn.putheader('Content-Type', 'application/octet-stream') | |
conn.putheader('X-Timestamp', "%016.05f" % time.time()) |
This file contains hidden or 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
# NOTE: all this code is completely untested. At best, it's syntactically | |
# valid, but don't bet on it. | |
import errno | |
import fcntl | |
import os | |
import splicetee | |
F_SETPIPE_SZ = getattr(fcntl, 'F_SETPIPE_SZ', 1031) |
This file contains hidden or 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
Resque.configure do |config| | |
config.redis = MockRedis.new | |
end |
This file contains hidden or 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 --git a/swiftclient/client.py b/swiftclient/client.py | |
index ee80769..275c6b7 100644 | |
--- a/swiftclient/client.py | |
+++ b/swiftclient/client.py | |
@@ -219,8 +219,9 @@ def http_connection(*arg, **kwarg): | |
return conn.parsed_url, conn | |
-def get_auth_1_0(url, user, key, snet): | |
- parsed, conn = http_connection(url) |
This file contains hidden or 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
# Starred reviews | |
# I star something when I want to follow it and make sure it gets in; that way I can find it again. | |
# I never have more than a half-dozen things starred at a time, or else it's pointless. | |
is:starred | |
# My pending changes | |
status:open AND owner:torgomatic | |
# Everything Swift-related that's ready for review (no WIP stuff) | |
status:open AND -status:workinprogress AND (project:openstack/swift OR project:openstack/python-swiftclient OR project:openstack/swift-bench OR project:openstack/object-api) |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# | |
# Benchmark the relative performance of stdlib's json, simplejson, and | |
# a wrapped simplejson that gives the same API as stdlib's json. | |
import benchmark | |
import hashlib | |
import json as stdjson | |
import simplejson |
This file contains hidden or 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 | |
import benchmark | |
import heapq | |
class BenchHeapq(benchmark.Benchmark): | |
def eachSetUp(self): | |
self.size = 500 |
This file contains hidden or 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 | |
import os | |
from swift.common.utils import get_logger | |
NLOGGERS = 500 | |
for _ in xrange(NLOGGERS): | |
get_logger({}) |