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 msgpack | |
import msgpack.fallback | |
import time | |
import random | |
def test_dict_key_access(keys): | |
s = time.time() | |
data = {} | |
for key in keys: |
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
$ git summary --line | |
project : ZeroNet-py3 | |
lines : 60541 | |
authors : | |
34892 shortcutme 57.6% | |
18225 HelloZeroNet 30.1% | |
1129 ZeroNet 1.9% | |
748 Matthew Bell 1.2% | |
631 Ivanq 1.0% |
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 python3 | |
""" | |
"PYSTONE" Benchmark Program | |
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) | |
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. | |
Translated from ADA to C by Rick Richardson. |
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 | |
import ctypes, socket, time | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
print("Max stdio:", ctypes.cdll.msvcr100._getmaxstdio()) | |
# print("Max stdio:", ctypes.cdll.msvcr100._setmaxstdio(2048)) | |
# via https://github.com/ariccio/DuplicateFileFinder/blob/master/py_duplicate_pysummer.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 hashlib | |
import struct | |
from coincurve import PrivateKey, PublicKey | |
from base58 import b58encode_check, b58decode_check | |
from hmac import compare_digest | |
RECID_MIN = 0 | |
RECID_MAX = 3 | |
RECID_UNCOMPR = 27 | |
LEN_COMPACT_SIG = 65 |
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 gevent.monkey | |
import time, sys, socket, struct | |
gevent.monkey.patch_all(sys=True) | |
broadcast_port = 11112 | |
def getMyIps(): | |
local_ips = [] | |
# get local ip using UDP and a broadcast address |
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
const CMD_INNER_READY = 'innerReady' | |
const CMD_RESPONSE = 'response' | |
const CMD_WRAPPER_READY = 'wrapperReady' | |
const CMD_PING = 'ping' | |
const CMD_PONG = 'pong' | |
const CMD_WRAPPER_OPENED_WEBSOCKET = 'wrapperOpenedWebsocket' | |
const CMD_WRAPPER_CLOSE_WEBSOCKET = 'wrapperClosedWebsocket' | |
class ZeroFrame { | |
constructor(url) { |
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 zipfile, time | |
import cStringIO as StringIO | |
data = StringIO.StringIO() | |
req = open("archive.zip@ref=master", "rb") | |
while True: | |
buff = req.read(1024) | |
if not buff: | |
break | |
data.write(buff) |
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 time | |
import json | |
import os | |
import sys | |
import re | |
import socket | |
from subprocess import call | |
from bitcoinrpc.authproxy import AuthServiceProxy |
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
# Modified: Werkzeug Debugger workaround in run_websocket(self): | |
import base64 | |
import hashlib | |
import warnings | |
from gevent.pywsgi import WSGIHandler | |
from .websocket import WebSocket, Stream | |
from .logging import create_logger |
NewerOlder