This file contains hidden or 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
"""virtualenv cloning script. | |
A script for cloning a non-relocatable virtualenv. | |
Virtualenv provides a way to make virtualenv's relocatable which could then be | |
copied as we wanted. However making a virtualenv relocatable this way breaks | |
the no-site-packages isolation of the virtualenv as well as other aspects that | |
come with relative paths and '/usr/bin/env' shebangs that may be undesirable. | |
Also, the .pth and .egg-link rewriting doesn't seem to work as intended. This |
This file contains hidden or 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
import os | |
import shutil | |
import subprocess | |
import sys | |
import tarfile | |
import urllib2 | |
LIBXML2_PREFIX = "libxml2" | |
LIBXSLT_PREFIX = "libxslt" | |
LIBXML2_FTPURL = "ftp://xmlsoft.org/libxml2/" |
This file contains hidden or 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
import eventlet | |
ev = eventlet.event.Event() | |
def dummyproc(): | |
eventlet.hubs.get_hub().switch() | |
g = eventlet.spawn(dummyproc) |
This file contains hidden or 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
import eventlet | |
def dummyproc(): | |
print 'dummyproc returning. but our parent is *old, dead* hub greenlet' | |
eventlet.sleep(0) # give hub a chance to run | |
g = eventlet.spawn(dummyproc) | |
print 'killing hub before spawned greenthread timer is run' | |
try: |
This file contains hidden or 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
""" Consumer for blocking on multiple eventlet queues. | |
Ensures that you never take more items from the queues than just | |
the first item you receive, and only when explicitly waiting for | |
and item. | |
""" | |
import eventlet | |
from eventlet.event import Event |
This file contains hidden or 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
{ | |
"options": {"failByDrop": false}, | |
"outdir": "./reports/servers", | |
"servers": [ | |
{"agent": "MyAwesomeServer", | |
"url": "ws://localhost:7000", | |
"options": {"version": 18}} | |
], |
This file contains hidden or 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
import os | |
import sys | |
import tempfile | |
import eventlet | |
from eventlet.green import subprocess | |
sock = eventlet.listen(('127.0.0.1', 0)) | |
port = sock.getsockname()[1] |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module ReflectBark where | |
import Control.Applicative | |
import Data.Aeson | |
import Data.Proxy | |
import Data.Reflection | |
data Bark = Bark | Woof | Yelp | Yap deriving Show |
This file contains hidden or 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
// when I have to write some node for the first time ... | |
Promise.fromGen = function (gen, v) { | |
return new Promise(function (resolve) { | |
var cont = function (g, v) { | |
var x = g.next(v); | |
if (x.done) { return resolve(x.value); } | |
return x.value.then((v) => cont(g, v)); | |
}; | |
cont(gen(v)); |
This file contains hidden or 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
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.Promotion.Prelude | |
import Data.Singletons.Prelude |