Skip to content

Instantly share code, notes, and snippets.

{
'workItems': [
{
'id': f"1111-2222-333",
'photoUrl': "https://landesblog-nrw-braucht-das.de/wp-content/uploads/2015/03/Eichhorn-auf-Grabstein.jpg",
'workOrder': 1,
'latitude': 42,
'longitude': 1
},
...
const tourSchema = {
version: 0,
title: 'tour schema',
description: 'describes a tour details',
type: 'object',
properties: {
name: {
type: 'string',
},
id: {
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
miracle2k / example.py
Created July 27, 2018 12:42
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
miracle2k / kucoin-fetch-fees.py
Last active May 31, 2021 18:30
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
miracle2k / convert.js
Created June 15, 2018 04:45
Convert Ethereum private keys to EOS private keys (the "Fallback method" to access your EOS tokens).
// 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')
@miracle2k
miracle2k / gist:69e43cda1dfbbe363575fbe9a7911995
Last active May 13, 2018 14:10
asyncio.gather is quite slow
"""
asyncio.gather might be getting faster:
See https://github.com/python/cpython/pull/4913
"""
import os
NUM=int(os.environ.get('NUM', 1))
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
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
const React = require('react');
const RelayPropTypes = require('react-relay/lib/RelayPropTypes');
const areEqual = require('fbjs/lib/areEqual');
const deepFreeze = require('react-relay/lib/deepFreeze');