Skip to content

Instantly share code, notes, and snippets.

Denis Krienbühl href

Block or report user

Report or block href

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@href
href / gist:9185284
Created Feb 24, 2014
Tests for Seantis Postfix
View gist:9185284
import time
import unittest
import poplib
import textwrap
from uuid import uuid4
from email import Encoders
from email.base64mime import encode
from email.MIMEBase import MIMEBase
from email.mime.text import MIMEText
View testing.postgresql bug
import testing.postgresql
if __name__ == '__main__':
postgresql = testing.postgresql.Postgresql()
try:
print('run server')
finally:
postgresql.stop()
View keybase.md

Keybase proof

I hereby claim:

  • I am href on github.
  • I am href (https://keybase.io/href) on keybase.
  • I have a public key whose fingerprint is 1C49 0401 B99C B9A6 85D6 9CEF 5027 CBD2 A4FE 6299

To claim this, I am signing this object:

View HTML5 Skeleton template.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@href
href / example.py
Created Nov 11, 2014
Virtualhost in Morepath
View example.py
import morepath
import re
from pprint import pprint
class App(morepath.App):
def request(self, environ):
request = super().request(environ)
@href
href / gist:00cabf7fe4d35f694879
Created Dec 7, 2014
A Stab at Chameleon Integration in Morepath
View gist:00cabf7fe4d35f694879
import inspect
import morepath
import os
class ChameleonApp(morepath.App):
@morepath.reify
def chameleon_template_paths(self):
""" Returns *absolute* paths to chameleon templates.
@href
href / test.py
Last active Aug 29, 2015
Neatly Serve Static Files with Morepath
View test.py
import inspect
import morepath
import os
from webob import static
class App(morepath.App):
@property
@href
href / gist:b72b317db2d679711883
Last active Aug 29, 2015 — forked from bubenkoff/gist:5764377
pytest-xdist with Buildout on Python 3
View gist:b72b317db2d679711883
buildout.cfg:
[py]
recipe = zc.recipe.egg
...
interpreter = py
initialization =
import sys, os
try:
@href
href / united.py
Created Sep 9, 2013
Simple function / class to put records into groups if they belong together
View united.py
class United(object):
""" Puts items added through 'append' into the same group as the last
item which was appended, as long as the matchfn which is passed the last
and the current item returns true.
e.g.
united = United(lambda last, current: last == current)
united.append(1)
@href
href / integration.py
Created Dec 9, 2016
An exploration of transaction integration for PonyORM
View integration.py
import transaction
from pony.orm import Database, PrimaryKey, Required
from pony.orm.core import DBSessionContextManager
from pony.orm.core import commit, flush, rollback
class CustomDBSessionContextManager(DBSessionContextManager):
def _enter(self, *args, **kwargs):
You can’t perform that action at this time.