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
from twisted.internet.defer import maybeDeferred | |
def withDeferred(contextManager, f, *args, **kwargs): | |
contextManager.__enter__() | |
def _exit(result): | |
contextManager.__exit__(None, None, None) | |
return result | |
def _exitEb(failure): |
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
from functools import wraps | |
from twisted.internet.defer import maybeDeferred | |
def produces(contentType, encoder=None): | |
def maybeEncode(result, request): | |
request.setHeader("content-type", contentType) | |
if encoder is not None: | |
return encoder(result) |
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
def fullyQualifiedName(obj): | |
if inspect.ismethoddescriptor(obj): | |
objclass = fullyQualifiedName(obj.__objclass__) | |
return '%s.%s' % (objclass, obj.__name__) | |
return txFullyQualifiedName(obj) |
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
(Damn) This Desert Air - Ghost I Own | |
2nd Thought - Just Hang On | |
3 Doors Down - Here Without You | |
3 Doors Down - It's Not My Time | |
3 Doors Down - Kryptonite | |
3 Doors Down - When I'm Gone | |
3 Doors Down - When You're Young | |
3 Inches of Blood - Battles and Brotherhood | |
30 Seconds to Mars - Attack | |
30 Seconds to Mars - Closer to the Edge |
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
<html> | |
<head> | |
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
google.load("visualization", "1", {packages:["corechart"]}); | |
google.setOnLoadCallback(drawChart); | |
function drawChart() { | |
var data = new google.visualization.DataTable(); | |
data.addColumn('string', 'didpie'); | |
data.addColumn('number', 'percentage'); |
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
--- nacl-20110221/curvecp/nanoseconds.c 2011-02-20 17:49:34.000000000 -0800 | |
+++ NaCl/curvecp/nanoseconds.c 2011-10-01 16:56:43.000000000 -0700 | |
@@ -1,4 +1,8 @@ | |
#include <time.h> | |
+#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time | |
+#include <mach/clock.h> | |
+#include <mach/mach.h> | |
+#endif | |
#include "nanoseconds.h" | |
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
=========={{2011,8,30},{17,35,32}}========== | |
{trace,<0.3.0>,call, | |
{erl_prim_loader,apply_archive, | |
[{prim_state,false,undefined,"/Users/dreid/bcd/rebar"}, | |
#Fun<erl_prim_loader.14.99960715>, | |
{error,enoent}, | |
"/Users/dreid/bcd/rebar"]}} | |
{trace,<0.3.0>,call,{prim_file,read_file_info,["/Users/dreid/bcd/rebar"]}} | |
{trace,<0.3.0>,return_from, | |
{prim_file,read_file_info,1}, |
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
proper_test_() -> | |
Properties = lists:filter(fun({F, _}) -> | |
case atom_to_list(F) of | |
"prop_" ++ _Rest -> | |
true; | |
_ -> | |
false | |
end | |
end, | |
bstrip_props:module_info(exports)), |
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
-module(bstrip). | |
-export([bstrip/1, bstrip/2]). | |
bstrip(Bin) -> | |
bstrip(Bin, both). | |
bstrip(Bin, left) -> | |
blstrip(Bin); |
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
## | |
## dialyzer.mk: Useful make targets for working with erlang's | |
## dialyzer. Manages a per-OTP version PLT which is then copied | |
## to your project directory and adds your dependencies to the | |
## plt. By default the OTP plt is stored in ~/.dialyzer so that | |
## it is used by all dialyzer.mk using projects. This can be | |
## changed with the PLT_BASE variable. | |
## | |
## Recommended usage is to add `include dialyzer.mk` to your | |
## projects Makefile. |