Skip to content

Instantly share code, notes, and snippets.


TRX1 tirinox

View GitHub Profile
tirinox /
Last active Apr 8, 2022
THORChain: calculation of total and circulating supply of Rune tokens
# Version 3 change log:
# -- Locked coins breakdown by category
# -- Moved "https://" outside of THORNode URL
# -- JSON pretty output
# Version 2 change log:
# -- Take into account BEP2 and ERC20 coins ready to burn in Asgard vaults
# -- Code was rewritten in OOP manner
import asyncio
import time
tirinox /
Last active Aug 22, 2021
This script sums all your ROWAN on balance and inside the Liquidity pools. USDC/USDT assets on balance are counted separately!
import asyncio
import sys
import aiohttp
def rowan_to_float(x, n=18):
return int(x) / (10 ** n)
tirinox /
Created Jun 23, 2021
Installation xchainpy on MacOS (M1 tested)

Installation of xchainpy on MacOS

  1. Install libsecp256k1 via Homebrew. If you don't have Homebrew then follow the installation instructions on their website.

brew install libsecp256k1

  1. Install wheel (reminder: you do all pip-things under your Python environment):

pip install wheel

import functools
import time
import types
class TimeItCritical:
def __new__(cls, obj=None, *, critical_time=DEFAULT_CRITICAL_TIME):
from collections import namedtuple
from pympler.asizeof import asizeof
class PointSimple:
def __init__(self, x, y):
self.x = x
self.y = y
tirinox /
Created Dec 31, 2020
New Year 2021 PyWay demo
# inspired by
import array
import os
from math import *
import colorsys
W, H = 640, 480
OUT_FILE = 'test_2.ppm'
# ЧБ версия для Windows, установи библиотеку:
# pip install windows-curses
import curses
import locale
from math import pi, cos, sin
POS_X, POS_Y, POS_A = 2, 2, 0 # Положение и поворот игрока на карте (начальные)
FOV = pi / 2 # Ширина угла обзор в радинах
RESOLUTION = 0.1 # разрешение шага луча
DEPTH = 16 # Максимальная глубина прорисовки
def register(cls, cfg: Config, db: DB, dp: Dispatcher, loc_man: LocalizationManager, **kwargs):
members = cls.__dict__.items()
for name, f in members:
if not hasattr(f, 'handler_stuff'):
handler_stuff = f.handler_stuff
tirinox /
Created Oct 24, 2020
This is a solution of week 1 for the Bitcoin and Cryptocurrency Technologies course (scrooge coin)
* This is a solution of week 1 for the Bitcoin and Cryptocurrency Technologies course (scrooge coin)
* Please, try yourself before looking this code
* I was able to get 100/100 score!
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
tirinox /
Created Apr 29, 2020
Dive into Mandelbrot fractal (GIF, Python)
from PIL import Image
from tqdm import tqdm
import math
W, H = 200, 200 # размеры картинки
ITER = 255
FRAMES = 100