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 bash | |
set -o nounset | |
set -o errexit | |
USER="$1" | |
INPUT_FILE="$2" | |
curl -s "https://github.com/$USER.keys" | tail -n 1 > "$USER.pub" | |
ssh-keygen -f "$USER.pub" -e -m PKCS8 > "$USER.pub.pem" |
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
add `import pdb; pdb.set_trace()` to `RpcConsumer.handle_message` and `ReplyListener.handle_message` |
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 get_lineage(request): | |
name = request.fixturename | |
node = str(request.node) | |
try: | |
return [name] + get_lineage(request._parent_request) | |
except AttributeError: | |
return [node] | |
print ' <- '.join(get_lineage(request)) |
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
$ cat covtest.py | |
import requests | |
requests.get('http://www.google.com') | |
$ coverage run -L covtest.py ; coverage report | |
Name Stmts Miss Cover | |
-------------------------------- | |
covtest.py 2 0 100% |
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 | |
import datetime | |
import os | |
import socket | |
import subprocess | |
import sys | |
ERROR = ' HTTP/1.1" 499' |
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
py27 runtests: commands[3] | /home/david/cov_src/.tox/py27/bin/python setup.py --quiet build_ext --inplace | |
py27 runtests: commands[4] | /home/david/cov_src/.tox/py27/bin/python igor.py test_with_tracer c | |
=== CPython 2.7.2+ with C tracer (.tox/py27/bin/python) === | |
....................................................................................................................................................................................................................................................................................................................................................................E.......................................................................................... | |
====================================================================== | |
ERROR: test_subprocess_with_pth_files (tests.test_process.ProcessStartupTest) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/david/cov_src/tests/test_process.py", line |
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
Welcome to the profile statistics browser. | |
collection27.prof% sort cu | |
collection27.prof% stats 100 | |
Thu Oct 9 14:08:04 2014 collection27.prof | |
10266541 function calls (9856337 primitive calls) in 10.750 seconds | |
Ordered by: cumulative time | |
List reduced from 12086 to 100 due to restriction <100> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <hiredis.h> | |
int main(int argc, char **argv) { | |
unsigned int j; | |
redisContext *conn; | |
redisReply *reply; |
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
# `and` doesn't work unfortunately. | |
# python doesn't allow overriding `and` behaviour | |
>>> print Booking.id == 1 and Booking.id == 2 | |
bookings.id = :id_1 | |
>>> print and_(Booking.id == 1, Booking.id == 2) | |
bookings.id = :id_1 AND bookings.id = :id_2 |
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 __future__ import print_function # want same code for py2/py3 | |
import inspect | |
import sys | |
has_signature = (sys.version_info[:2] >= (3, 3)) | |
BAD_ARGS, GOOD_ARGS = (1, 2) |