This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@relayRoot | |
@relayContainer({ | |
client: () => Relay.QL` | |
fragment on Client { | |
id, | |
menuitems(first: 50) { | |
} | |
} | |
` | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert an existing docker container into a "docker run" command line. | |
# | |
# This is useful when trying to debug containers that have been created | |
# by orchestration tools. | |
# | |
# Install jq: stedolan.github.io/jq/ | |
function format_run() { | |
cid=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Inspired by this approach: | |
- https://twitter.com/zzzeek/status/1279069782533386247 | |
- https://gist.github.com/zzzeek/2a8d94b03e46b8676a063a32f78140f1 | |
- https://gist.github.com/zzzeek/33943060f7a08cf9e82bf8df1f0f75de, https://gist.github.com/zzzeek/4e89ce6226826e7a8df13e1b573ad354#file-asyncio_plus_greenlet-py-L28 | |
Essentially we use greenlets to make the IO layer async and the top layer uses async/await, but everything in | |
between can be regular sync code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tweak the existing Logging integration to work with Logbook. | |
# Mostly copy-paste from https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/logging.py | |
# | |
# Usage: | |
# | |
# StreamHandler(sys.stdout, level="INFO").push_application() | |
# SentryErrorHandler(bubble=True, level='ERROR').push_application() | |
# SentryBreadcrumbHandler(bubble=True, level='INFO').push_application() | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ccxt | |
import json | |
import time | |
import re | |
import decimal | |
import math | |
kucoin = ccxt.kucoin({ | |
"apiKey": "", | |
"secret": "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add an "CMS internal link" option to the Link plugin. | |
* | |
* This was adapted from a similar plugin for Drupal (version 7.x-2.3): | |
* Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr> | |
* http://www.absyx.fr | |
* https://drupal.org/project/ckeditor_link | |
* | |
* Portions of code: | |
* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sqlalchemy | |
from sqlalchemy import UnicodeText | |
from sqlalchemy.ext.mutable import Mutable | |
from datetime import datetime | |
from collections import OrderedDict | |
__all__ = ('JSON', 'JsonRaw') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit | |
height: 620 | |
scrolling: no | |
border: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
height: 700 |
NewerOlder