Add this in your ini file:
[alembic:exclude]
tables = spatial_ref_sysIn env.py:
| import ccxt | |
| def get_price(exchange_client, pair) -> float: | |
| return exchange_client.fetch_ticker(pair).get("last") | |
| if __name__ == "__main__": | |
| binance = (ccxt.binance(), "XRP/USDT") | |
| bitfinex = (ccxt.bitfinex(), "XRP/USD") |
| #!/bin/bash | |
| # install websocat | |
| # cargo install --features=ssl websocat | |
| # --features=ssl needs to be included to connect to wss:// | |
| # we use `<<<` to send a string into the command: | |
| # echo '{"command"...}' | websocatt ... | |
| # is equivalent |
| #!/usr/bin/env python3 | |
| """ | |
| Prints out the Ledger No. and the total txns, along with a visual indication. | |
| Illustrates a raw web socket connection and consuming the messages with asyncio | |
| Setup: | |
| If you're running an XRPL node, run this script on the node with the admin |
| Tested working 20 Jun 2021, irssi version 1.2.3 | |
| This is a TLDR version of https://blog.crunchprank.net/connecting-to-twitch-chat-via-irssi/ | |
| Get your OAuth token (password) here: https://twitchapps.com/tmi/ | |
| # Network setup: | |
| /network add -nick YOUR_TWITCH_USERNAME twitch | |
| /server add -auto -ssl -network Twitch irc.chat.twitch.tv 6697 YOUR_OAUTH_TOKEN |
| #!/usr/bin/env bash | |
| # Runs a command wrapped in btrfs snapper pre-post snapshots. | |
| # Usage: $ snp <commands> | |
| # e.g.: $ snp pacman -Syyu | |
| # The latest version of this script is hosted at https://gist.github.com/erikw/5229436 | |
| log_path="/var/local/log/snp" | |
| date=$(date "+%Y-%m-%d-%H%M%S") | |
| log_file="${log_path}/snp_${date}.log" |
Add this in your ini file:
[alembic:exclude]
tables = spatial_ref_sysIn env.py:
| # modified from https://stackoverflow.com/a/10660730 | |
| rawurlencode() { | |
| local string="${1}" | |
| local strlen=${#string} | |
| local encoded="" | |
| local pos c o | |
| for (( pos=0 ; pos<strlen ; pos++ )); do | |
| c=${string:$pos:1} | |
| case "$c" in |
| import string | |
| MIN_LEN, MAX_LEN = 8, 16 | |
| from random import randint, choice | |
| characters = string.ascii_letters + string.punctuation + string.digits | |
| password = lambda : "".join(choice(characters) for x in range(randint(MIN_LEN, MAX_LEN))) | |
| print(password()) |
| class Base(): | |
| def __init__(self, *a, **k): | |
| exec( "self.{} = self._op".format( | |
| kw.get('override_fn_name', | |
| self.__class__.__name__.lower()))) | |
| def _op(self, *a, **k): | |
| pass | |