Instantly share code, notes, and snippets.

View example.py
async with open_special_nursery() as nursery:
nursery.start_soon(self.wait_for_stop_signal, daemon=True)
nursery.start_soon(func, *a)
View kucoin-fetch-fees.py
import ccxt
import json
import time
import re
import decimal
import math
kucoin = ccxt.kucoin({
"apiKey": "",
"secret": ""
View convert.js
// Extracted from https://github.com/eoscafe/eoskeyio
const ecc = require('eosjs-ecc');
const eth = require('ethereumjs-util');
let ethereumPrivateKey = 'FILL THIS IN';
if(eth.isValidPrivate(Buffer.from(ethereumPrivateKey, 'hex'))) {
let ethereumAddress = '0x' + eth.privateToAddress(Buffer.from(ethereumPrivateKey, 'hex')).toString('hex')
let ethereumPublicKey = eth.privateToPublic(Buffer.from(ethereumPrivateKey, 'hex')).toString('hex')
View gist:69e43cda1dfbbe363575fbe9a7911995
"""
asyncio.gather might be getting faster:
See https://github.com/python/cpython/pull/4913
"""
import os
NUM=int(os.environ.get('NUM', 1))
View gist:617960178370ff5bce802950a89d169b
I171027 11:30:00.813229 54 storage/replica_proposal.go:415 [n1,s1,r642/7:/System/tsd/cr.node.sql.mem.i…] new range lease repl=(n1,s1):7 start=1508700052.899403636,0 epo=4191 pro=1509103306.070606563,0 following repl=(n1,s1):7 start=1508700052.899403636,0 epo=4191 pro=1509103306.070606563,0
I171027 11:30:00.814065 54 storage/replica_proposal.go:415 [n1,s1,r642/7:/System/tsd/cr.node.sql.mem.i…] new range lease repl=(n1,s1):7 start=1508700052.899403636,0 epo=4191 pro=1509103306.070606563,0 following repl=(n1,s1):7 start=1508700052.899403636,0 epo=4191 pro=1509103306.070606563,0
I171027 11:30:00.814893 54 storage/replica_proposal.go:415 [n1,s1,r642/7:/System/tsd/cr.node.sql.mem.i…] new range lease repl=(n1,s1):7 start=1508700052.899403636,0 epo=4191 pro=1509103306.070606563,0 following repl=(n1,s1):7 start=1508700052.899403636,0 epo=4191 pro=1509103306.070606563,0
I171027 11:30:00.815672 54 storage/replica_proposal.go:415 [n1,s1,r642/7:/System/tsd/cr.node.sql.mem.i…] new range lease repl=(n1,s1):7 start=15087
View postgres-ramdisk.sh
diskutil erasevolume HFS+ "postgres_ramdisk" `hdiutil attach -nomount ram://409600`
sudo chown -R $(whoami) /Volumes/postgres_ramdisk/
pg_ctl -D /Volumes/postgres_ramdisk/postgres init
pg_ctl -D /Volumes/postgres_ramdisk/postgres start
View ReactRelayQueryRenderer.js
const React = require('react');
const RelayPropTypes = require('react-relay/lib/RelayPropTypes');
const areEqual = require('fbjs/lib/areEqual');
const deepFreeze = require('react-relay/lib/deepFreeze');
View FixedReactRelayRefetchContainer.js
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactRelayRefetchContainer
*
View README.md

Every language code in the CLDR and it's localized, native displayName. Perfect for language selector screens.

Generated from CLDR using:

for code in  main/*; do code=$(basename $code); cat main/$code/languages.json | jq --arg code $code '{($code): .main[$code].localeDisplayNames.languages[$code] }' ; done  | jq  -s '. | add | with_entries( select( .value != null ) ) '
View gist:3ca96a0b6d9739a9665e9dc3992be1ba
from flask import Flask, current_app
from cryptography.hazmat.primitives import hashes
import base64
import confcollect
from acme import jose
DEFAULT_CONFIG = {
'DEBUG': False,
'ACCOUNT_THUMBPRINT_BASE64': '',
'ACCOUNT_JSON': ''