This file contains 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 login_first(test): | |
"""Decorator offering convenience login for tests that require it.""" | |
def _login(self): | |
self.client.login( | |
username='testusername', | |
password='testpassword') | |
return test(self) | |
return _login |
This file contains 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
--- /Users/hynek/Downloads/python.vim 2012-06-21 15:44:18.000000000 +0200 | |
+++ python.vim 2012-06-21 15:38:52.000000000 +0200 | |
@@ -119,11 +119,7 @@ | |
return indent(parlnum) + &shiftwidth | |
endif | |
else | |
- if closing_paren | |
- return parcol - 1 | |
- else | |
- return parcol |
This file contains 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
#!/bin/bash | |
# A quick and dirty way to package Graphite using fpm and a custom target. | |
# (c) by Hynek Schlawack, MIT licence, USE AT OWN RISK. | |
# EXECUTE DIRECTLY ON A BUILDBOT -- IT USES REAL PATHS SINCE GRAPHITE IS PRICKY | |
# Necessary Ubuntu dependency for building: build-essential, libcairo-dev and | |
# fpm which isn't packaged unfortunately: https://github.com/jordansissel/fpm |
This file contains 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 OpenSSL import SSL | |
from twisted.internet import ssl | |
class TLSContextWithChainFileFactory(ssl.DefaultOpenSSLContextFactory): | |
""" | |
A SSLContext factory for TLS only and C{certificateFileName} is set as the | |
chain file. Add all chain files that lead from the CA to your certificate. | |
""" | |
def cacheContext(self): |
This file contains 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 foo(): | |
""" | |
... Doc string goes here | |
""" | |
pass |
This file contains 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 f(x,*,y,z): | |
... print(x, y, z) | |
... | |
>>> f(1,2,3) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: f() takes 1 positional argument but 3 were given |
This file contains 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: | |
_answer = 42 | |
@property | |
def answer(self): | |
print('getting!') | |
return self._answer | |
@answer.setter | |
def answer(self, new_answer): | |
print('setting!') |
This file contains 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
$ ffind '*anypattern*' | |
Traceback (most recent call last): | |
File "/usr/local/bin/ffind", line 843, in <module> | |
main() | |
File "/usr/local/bin/ffind", line 819, in main | |
if options.literal or not is_re(query): | |
File "/usr/local/bin/ffind", line 702, in is_re | |
return not all(c.lower() in string.letters + '_-' for c in s) | |
File "/usr/local/bin/ffind", line 702, in <genexpr> | |
return not all(c.lower() in string.letters + '_-' for c in s) |
This file contains 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 | |
from __future__ import print_function | |
import os | |
import sys | |
import subprocess | |
ext = os.environ['MARKED_EXT'].lower() |
This file contains 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
-----BEGIN PGP SIGNED MESSAGE----- | |
Hash: SHA256 | |
I have a new GPG key: 7F69F181 with fingerprint C2A0 4F8 6 AC E2 8 ADC F817 DBB 7 AE 25 3 622 7F69 F18 1. If you've signed the old one (C6197B3C, used to sign this message), I would appreciate a signature on the new one too. | |
-----BEGIN PGP SIGNATURE----- | |
Version: GnuPG/MacGPG2 v2.0.22 (Darwin) | |
Comment: GPGTools - http://gpgtools.org | |
iF4EAREIAAYFAlKUh/oACgkQAuAjRMYZezy5WwD/dAtYqosqWprtSGEKTRL59wJ8 | |
nRmxcEiMTljHVhbs6y4BAMB9x7iHOQUy/uKpHiGNgIuWCpoB/a9Z7lBUXuPRulNY |
OlderNewer