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
/ patch HTTP GET/POST handler to not run arbitary Q code from the url | |
/ this is the minimal handler to keep the built-in UI functional. It evaluates queries | |
/ that only match whole tables and global variables from the root namespace | |
.h.val:{-2 .Q.s1 x;$[x in (string each tables `.),string each system "v";:value x;'protect]} | |
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
from textual.app import App, ComposeResult | |
from textual.widgets import Label, Button, Footer | |
from typing import Dict, Optional, List | |
from textual.screen import ModalScreen | |
from textual.binding import Binding | |
from textual.widget import Widget | |
from textual.containers import Grid, Horizontal, Vertical | |
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
from textual.app import App, ComposeResult | |
from textual.widgets import DataTable | |
from typing import Dict | |
ROWS = [ | |
(4, "Joseph Schooling", "Singapore", 50.39), | |
(1, "Aleksandr Sadovnikov", "Russia", 51.84), | |
(10, "Darren Burns", "Scotland", 51.84), | |
] |
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
0x3856db0ac0a8b1fe5fe65e3629358742f1a0b5f2 |
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 argparse | |
import yaml | |
parser = argparse.ArgumentParser() | |
parser.add_argument('files', metavar='YAMLFILES', type=argparse.FileType('r'), nargs='*') | |
args = parser.parse_args() | |
y = {'apiVersion': 'v1', 'kind': 'Config', 'clusters': [],'contexts': [], | |
'current-context': 'dev-eu-west-1-aws-bitmex', 'preferences': {}, 'users': []} | |
for a in args.files: | |
f = yaml.load(a, Loader=yaml.Loader) |
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
from bitmex_websocket import BitMEXWebsocket | |
import logging | |
from time import sleep | |
def run(): | |
ws = BitMEXWebsocket(endpoint="https://www.bitmex.com/api/v1", symbol="XBTUSD", | |
api_key=None, api_secret=None) | |
logger = logging.getLogger() |
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 sys, os | |
from twisted.python.runtime import platform | |
from twisted.python import log | |
from twisted.names import root, resolve, cache, client | |
from twisted.internet import utils | |
def parseIpconfigDNSServers(output): | |
servers = [] | |
found = False |