Skip to content

Instantly share code, notes, and snippets.

View tirinox's full-sized avatar
🎯
Focusing

TRX1 tirinox

🎯
Focusing
View GitHub Profile
# ЧБ версия для 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 # Максимальная глубина прорисовки
@tirinox
tirinox / class-decoratory.py
Last active April 28, 2023 00:49
Декоратор класса. Для канала PyWay.
# copyright https://t.me/pyway
import time
# это вспомогательный декоратор будет декорировать каждый метод класса, см. ниже
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
import hashlib
import ecdsa
import os
from binascii import hexlify
from base58 import b58encode
# Installation:
# pip install base58 ecdsa
# Use that service to make sure that this generator works well:
@tirinox
tirinox / web_screenshot.py
Created May 1, 2019 17:04
Make a screenshot of any webpage using Python, Selenium and Chrome
# 1) pip install selenium
# 2) ChromeDriver: http://chromedriver.chromium.org/downloads
from selenium import webdriver
DRIVER = 'chromedriver'
driver = webdriver.Chrome(DRIVER)
driver.get('https://erugame.ru/') # какой сайт
driver.save_screenshot("screenshot.png")
@tirinox
tirinox / most_active_savers.txt
Last active December 3, 2022 19:29
Most active THORChain savings vaults members
pool = 'ETH/ETH'; len(members) = 142
[ 1/ 142]pool = 'ETH/ETH' and member ='0x00c649c5adf42a578b9e67d3eef5d7b7c971b7ac' =>> has 1 savings txs
[ 2/ 142]pool = 'ETH/ETH' and member ='0x026d0875cca6e6cfa0a7f0b2a980227c15227e31' =>> has 1 savings txs
[ 3/ 142]pool = 'ETH/ETH' and member ='0x03f1d34bc2ca357f4911041e5ac625092d27c616' =>> has 1 savings txs
[ 4/ 142]pool = 'ETH/ETH' and member ='0x0559a40c957e288f3fbd49deafe6ee96453b2079' =>> has 1 savings txs
[ 5/ 142]pool = 'ETH/ETH' and member ='0x090e6cd6c13dac5d58ee9441d0e72bbde5ee00b4' =>> has 1 savings txs
[ 6/ 142]pool = 'ETH/ETH' and member ='0x0b58c552e5c7467a089435178b55faa8ec0a2106' =>> has 1 savings txs
[ 7/ 142]pool = 'ETH/ETH' and member ='0x0ea83447807941fb777bb60137b030b3e795dd7e' =>> has 1 savings txs
[ 8/ 142]pool = 'ETH/ETH' and member ='0x10dc2287e36bcb16024ec2ee610ce06eb7fe7468' =>> has 1 savings txs
[ 9/ 142]pool = 'ETH/ETH' and member ='0x152feb2b3d4dbb5a5df06c0149c8a78bd969845b' =>> has 1 savings txs
import math
import random
MILESTONE_DEFAULT_PROGRESSION = [1, 2, 5]
def milestone_nearest(x, before=True, progress=None):
progress = progress or MILESTONE_DEFAULT_PROGRESSION
x = int(x)
if x <= 0:
@tirinox
tirinox / thor_circulating_supply.py
Last active April 8, 2022 15:44
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
tirinox / sifchain_count_my_rowan.py
Last active August 22, 2021 08:27
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
tirinox / Notebook_animation.ipynb
Last active June 23, 2021 10:17
Демонстрация анимаций в Jupyter Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tirinox
tirinox / README.md
Created June 23, 2021 09:20
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