View .gitignore
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
/__pycache__ | |
/build | |
*.so | |
_cfilters.* | |
View improf.py
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
import sys | |
from importlib._bootstrap import _find_and_load | |
from resource import getrusage, RUSAGE_SELF | |
from contextlib import contextmanager | |
IMPORT_ENTRY = _find_and_load.__code__ | |
def get_mem(): |
View file_lock.py
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
@contextmanager | |
def lock(file_name, block=False): | |
fp = open(file_name, 'w') | |
opts = fcntl.LOCK_EX | |
if not block: | |
opts |= fcntl.LOCK_NB | |
try: | |
fcntl.lockf(fp, opts) |
View asyncio_statsd.py
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
import asyncio | |
import statsd | |
class AsyncStatsClient(statsd.StatsClient): | |
class DummyProto(asyncio.DatagramProtocol): | |
pass | |
def __init__(self, host='localhost', port=8125, prefix=None, maxudpsize=512): | |
self._addr = host, port |
View ssl-perf
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 time | |
import sys | |
import socket | |
import ssl | |
import math | |
def percentile(N, percent, key=lambda x:x): |
View .gitignore
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
*.pyc |
View JIRA archive old releases
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
function archiveOldReleases(dt) { | |
$('tr.project-config-version-released').each((idx, obj) => { | |
$obj = $(obj); | |
if (!$obj.hasClass('project-config-version-archived')) { | |
var rdate = $obj.attr('data-releasedate'); | |
if (rdate && rdate < dt) { | |
$.ajax({ | |
type: 'PUT', | |
url: '/rest/api/2/version/' + $obj.attr('data-id'), | |
contentType: 'application/json', |
View throng
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 os | |
import time | |
import argparse | |
import signal | |
from subprocess import Popen | |
class Pool(object): | |
def __init__(self, process_count, args): |
View bench.py
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
import os | |
from btasks import add | |
COUNT = 10000 | |
if os.environ['QUEUE'] == 'rq': | |
from rq import Queue | |
from redis import Redis |
View http-import-fox
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.path | |
import glob | |
import json | |
import argparse | |
import sqlite3 | |
NewerOlder