Skip to content

Instantly share code, notes, and snippets.

miracle2k /
Created Feb 22, 2019
Convert the output from Google Cloud Speech Recognition to ELRC.
Convert the output from Google Cloud Speech Recognition to ELRC.
import json, sys
class ELRC:
def __init__(self):
self.lines = []
View fetch-upload.js
function fetchWithProgress(url, opts={}, onProgress) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest(); || 'get', url);
for (var k in opts.headers || {}) {
xhr.setRequestHeader(k, opts.headers[k]);
xhr.onload = e => {
View GenericTouchable-babel-with-metro-preset.js
// Generated with NODE_ENV=development yarn run babel node_modules/react-native-gesture-handler/touchables/GenericTouchable.js --presets module:metro-react-native-babel-preset --compact false
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
exports.default = exports.TOUCHABLE_STATE = void 0;
View api.js
'workItems': [
'id': f"1111-2222-333",
'photoUrl': "",
'workOrder': 1,
'latitude': 42,
'longitude': 1
View gist:6cc7674148177d20fa310be4ce52fd5a
const tourSchema = {
version: 0,
title: 'tour schema',
description: 'describes a tour details',
type: 'object',
properties: {
name: {
type: 'string',
id: {
View gist:a19d9688fd9f350e05b25d3cfea6bd31
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/michael/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8ddd20d2eeaac5cf966cb215a87d3809/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
/Users/michael/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8ddd20d2eeaac5cf966cb215a87d3809/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.
/Users/michael/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8ddd20d2eeaac5cf966cb215a87d3809/res/values-v26/values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
/Users/michael/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/8ddd20d2eeaac5cf966cb215a87d3809/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle no
miracle2k /
Created Jul 27, 2018
Trio nursery that can spawn tasks in 'daemon' and 'main' modes.
async with open_special_nursery() as nursery:
nursery.start_soon(self.wait_for_stop_signal, daemon=True)
nursery.start_soon(func, *a)
miracle2k /
Last active Dec 9, 2018
Fetch fees and precisions for all currencies from kucoin
import ccxt
import json
import time
import re
import decimal
import math
kucoin = ccxt.kucoin({
"apiKey": "",
"secret": ""
miracle2k / convert.js
Created Jun 15, 2018
Convert Ethereum private keys to EOS private keys (the "Fallback method" to access your EOS tokens).
View convert.js
// Extracted from
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:
import os
NUM=int(os.environ.get('NUM', 1))
You can’t perform that action at this time.