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
>>> class Foo(object): pass | |
... | |
>>> foo = Foo() | |
>>> setattr(foo, 'β', 'snowman') | |
>>> getattr(foo, 'β') | |
'snowman' |
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
// jQuery | |
Raven.plugin({ | |
// the main, base object | |
object: $, | |
// the keys within that object to wrap | |
keys: ['success', 'failure'], | |
// optionally wrap the arguments to the callbacks, if they are themselves functions | |
args: true | |
}) |
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
""" | |
cramermath | |
~~~~~~~~~~ | |
Usage: | |
>>> import cramermath | |
>>> cramermath.log(10) | |
0.014728067495500818 | |
""" |
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
>>> import sourcemap | |
>>> index = sourcemap.load(open('jquery.min.map')) # Parses the map | |
>>> index.lookup(line=1, column=3000)) # Search in index for a Token |
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
class A(object): | |
def hook(self, f): | |
def intime(*args): | |
print intime.atime | |
intime.atime += 1 | |
return f(*args) | |
intime.atime = 0 | |
return intime | |
>>> f = A().hook(lambda b: b + 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" | |
"os/exec" | |
"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
βββββββ βββ ββββββ βββββ β ββ ββββββ | |
ββββ ββββββββββ β ββββ βββ ββ βββββββ β | |
βββ βββββββ ββββ ββββ ββββββ βββββ ββββ | |
ββββ βββββ β ββββββ ββ ββββ ββββ β βββ | |
βββββββ βββββββββββββββββββββ ββββββββ βββββββββ | |
βββ β ββ β βββ β βββ βββ β ββββ β β β βββ β β | |
β β β β ββ ββ β β β ββ β ββββ β β β ββ β β | |
β β β β ββ β β β β βββ β β β β β | |
β β β β β β | |
β |
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
--- cassandra.orig 2014-08-17 14:45:54.000000000 +0000 | |
+++ cassandra 2014-08-20 01:27:53.000000000 +0000 | |
@@ -38,6 +38,8 @@ | |
exit 3 | |
fi | |
+export JVM_OPTS | |
+ | |
# Export JAVA_HOME, if set. | |
[ -n "$JAVA_HOME" ] && export JAVA_HOME |
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
import zlib | |
from django.db import models | |
from django.utils import six | |
from django.utils.encoding import force_bytes | |
__all__ = ('GzippedTextField',) | |
class GzippedTextField(six.with_metaclass(models.SubfieldBase, models.BinaryField)): |
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
import re | |
import json | |
from django.core.serializers.json import DjangoJSONEncoder | |
from django.http import HttpResponse, HttpResponseBadRequest | |
# Reserved words list from http://javascript.about.com/library/blreserved.htm | |
JAVASCRIPT_RESERVED_WORDS = frozenset(( | |
'abstract', 'as', 'boolean', 'break', 'byte', 'case', 'catch', 'char', | |
'class', 'continue', 'const', 'debugger', 'default', 'delete', 'do', |