Instantly share code, notes, and snippets.

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
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
*