Skip to content

Instantly share code, notes, and snippets.

Avatar

Tristan Seligmann mithrandi

View GitHub Profile
View gist:77d94af7476c5eea5ed5
tests/hazmat/backends/test_openssl.py .
========================================================================================================== 1 passed in 0.19 seconds ==========================================================================================================
Program received signal SIGSEGV, Segmentation fault.
0x080dd9db in visit_decref () at ../Modules/gcmodule.c:360
360 in ../Modules/gcmodule.c
(gdb) bt
#0 0x080dd9db in visit_decref () at ../Modules/gcmodule.c:360
#1 0x080ddb2d in dict_traverse () at ../Objects/dictobject.c:2114
View gist:5c1e09486154a092c5bb
tests/hazmat/backends/test_openssl.py
Program received signal SIGSEGV, Segmentation fault.
PyErr_SetObject () at ../Python/errors.c:104
104 ../Python/errors.c: No such file or directory.
(gdb) bt
#0 PyErr_SetObject () at ../Python/errors.c:104 [0/9182]
#1 0x0817da0b in PyErr_FormatV (vargs=0xffffbc88 "9\372\065\b\305D\030\b|GC\b\250\274\377\377p'\227\367\305\267\035\bp'\227\367", format=0x8364644 "an integer is required (got type %.200s)", exception=<type at remote 0x8478b20>)
at ../Python/errors.c:784
#2 PyErr_Format () at ../Python/errors.c:799
#3 0x081db616 in _PyLong_FromNbInt () at ../Objects/longobject.c:145
View gist:347185c625358b6ab9b9
tests/hazmat/backends/test_openssl.py ...............ss..............s..........ss.ss.ss....
Program received signal SIGSEGV, Segmentation fault.
_PyObject_Malloc.lto_priv.1306 () at ../Objects/obmalloc.c:1159
1159 ../Objects/obmalloc.c: No such file or directory.
(gdb) bt
#0 _PyObject_Malloc.lto_priv.1306 () at ../Objects/obmalloc.c:1159
#1 0x0815e69a in PyObject_Malloc (size=<optimized out>) at ../Objects/obmalloc.c:351
#2 _PyObject_GC_Malloc (basicsize=<optimized out>) at ../Modules/gcmodule.c:1725
#3 _PyObject_GC_New () at ../Modules/gcmodule.c:1748
#4 0x081ef612 in PyCell_New (obj=0x0) at ../Objects/cellobject.c:10
@mithrandi
mithrandi / test.py
Created Oct 7, 2015
trial / threadpool interaction
View test.py
from twisted.internet import reactor
from twisted.internet.defer import gatherResults
from twisted.internet.threads import deferToThread
from twisted.trial.unittest import TestCase
from time import sleep
class Case(TestCase):
def test_threads(self):
return start()
@mithrandi
mithrandi / resource.py
Last active Sep 22, 2015
txspinneret route('') issue
View resource.py
from txspinneret.interfaces import ISpinneretResource
from txspinneret.route import Router, routedResource
from zope.interface import implementer
@routedResource
@implementer(ISpinneretResource)
class Root(object):
router = Router()
@mithrandi
mithrandi / gist:3e16ea08bea3ab221137
Created May 14, 2015
Halcyon-on-Heroku dockerfile
View gist:3e16ea08bea3ab221137
FROM heroku/cedar:14
MAINTAINER Tristan Seligmann <mithrandi@mithrandi.net>
ENV HALCYON_NO_SELF_UPDATE=1
RUN ["git", "clone", "-b", "v1.0.5", "https://github.com/mietek/halcyon.git", "/halcyon"]
RUN ["/halcyon/halcyon", "paths"]
@mithrandi
mithrandi / ax.fish
Last active Aug 29, 2015
Fish function for development with axiomatic
View ax.fish
function ax
if not set -q PROJECT
set PROJECT (basename $VIRTUAL_ENV)
end
set -l SOURCEDIR {$HOME}/code/{$PROJECT}
if test -z "$PROJECT" -o ! -d "$SOURCEDIR"
echo "Unable to locate project; do you have a virtualenv activated?"
return 1
end
set -l BRANCH (hg --repository $SOURCEDIR branch)
@mithrandi
mithrandi / gist:fdeeb25cb05c846eceab
Last active Aug 29, 2015
Version of map handling deferreds/errors
View gist:fdeeb25cb05c846eceab
(ns clj-amp.core
(:require [manifold.deferred :as d]
[manifold.stream :as s]))
(defn- map'
"Like manifold.stream/map, except handles deferreds and closes the stream if an error occurs."
([f s]
(let [s' (s/stream)]
(s/connect-via
s
(fn [msg]
View gist:8922bd4fbff4b7263d4b
def fetch(..., clock=None):
if clock is None:
from twisted.internet import reactor as clock
def handleResponse(response):
# ...
d = agent.request(method, url, Headers(h), body)
call = clock.callLater(timeout, d.cancel)
def cancelTimeout(result):
@mithrandi
mithrandi / legacy
Created Feb 20, 2015
Axiom legacy declaration generator
View legacy
#!/usr/bin/env python
from twisted.python.reflect import namedAny
template = """
declareLegacyItem(
typeName=%r,
schemaVersion=%d,
attributes=dict(
%s))
"""