I hereby claim:
- I am malthe on github.
- I am malthe (https://keybase.io/malthe) on keybase.
- I have a public key ASDrplWb0b2fpoxO3wkqNFadCp9nMBMad9cUiGufDM4PQAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
function dedent(text) { | |
var re_whitespace = /^([ \t]*)(.*)\n/gm; | |
var l, m, i; | |
while ((m = re_whitespace.exec(text)) !== null) { | |
if (!m[2]) continue; | |
if (l = m[1].length) { | |
i = (i !== undefined) ? Math.min(i, l) : l; | |
} else break; |
import base64 | |
import requests | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.Hash import SHA | |
from Crypto.PublicKey import RSA | |
from Crypto.Util.asn1 import DerSequence | |
def import_pubkey_from_x509(pem): |
import re | |
import ast | |
from chameleon.tales import TalesExpr | |
from chameleon.codegen import template | |
from chameleon.astutil import load | |
from chameleon.astutil import Symbol | |
from chameleon.exc import ExpressionError |
Index: src/Zope2/App/startup.py | |
=================================================================== | |
--- src/Zope2/App/startup.py (revision 126687) | |
+++ src/Zope2/App/startup.py (working copy) | |
@@ -327,6 +327,9 @@ | |
def abort(self): | |
transaction.abort() | |
+ def get(self): | |
+ return transaction.get() |
# Based on code by Travis Parker | |
import bisect | |
import operator | |
try: | |
xrange | |
except NameError: | |
xrange = range |
import functools | |
_invalid = object() | |
def cached_property(_get, _set, _del=None): | |
name = _get.__name__ | |
mangled = "_" + name | |
@functools.wraps(_get) | |
def cached_get(inst): |
;; .emacs | |
;; ========================================================================= | |
;; | |
;; Malthe Borch | |
;; | |
;; Last updated: Fri Feb 24, 2012. | |
;; Add own packages to load path | |
(let* ((my-lisp-dir "~/.emacs.d/site-lisp") | |
(default-directory my-lisp-dir) |
(defun nuke-dashes () | |
(interactive) (save-excursion (goto-char (point-min)) (while (re-search-forward "^-" nil t) (replace-match "")))) | |
(global-set-key "\C-d" 'nuke-dashes) |
import os | |
import re | |
from htmlentitydefs import name2codepoint | |
# Must install the `hyphenator` library from PyPi! | |
from hyphenator import Hyphenator | |
# Firefox comes with an English hyphenation dictionary | |
path = os.popen('locate hyph_en_US.dic').readlines()[0].strip() |