Skip to content

Instantly share code, notes, and snippets.

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 ) ) '

/**
* 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
*
const React = require('react');
const RelayPropTypes = require('react-relay/lib/RelayPropTypes');
const areEqual = require('fbjs/lib/areEqual');
const deepFreeze = require('react-relay/lib/deepFreeze');
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
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
@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))
@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 / 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 / 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)
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