Skip to content

Instantly share code, notes, and snippets.

View serjflint's full-sized avatar

Sergei Iakhnitskii serjflint

  • Philadelphia, PA
View GitHub Profile
@serjflint
serjflint / day_18.py
Created December 18, 2021 09:20
Day 18 Try 1
import copy
import functools
import typing as tp
Value = tp.Union[int, tp.List]
Pair = tp.List[Value]
def loader(lines: tp.Iterable[str]):
@serjflint
serjflint / build.bat
Created August 11, 2020 07:01
Trio multi-thread file update idling
pyinstaller --onefile --noconfirm --hiddenimport=win32timezone ^
--hiddenimport=pkg_resources.py2_warn --hiddenimport=win32serviceutil ^
--noupx --uac-admin --name=AG_Loader cli.py
@serjflint
serjflint / pyproject.toml
Created August 1, 2020 06:37
Pyproject.toml
[tool.poetry]
name = "zkd"
version = "0.1.0"
description = ""
authors = ["Sergei Iakhnitskii <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.6"
cython = "^0.29.21"
geohash-hilbert = "^1.4.0"
@serjflint
serjflint / trio_lru_cache.py
Created July 31, 2020 18:00
This gist is 100% port of Python built-in function functools.lru_cache for trio
import threading
import weakref
from collections import namedtuple
from functools import update_wrapper
import trio
# Idea of using weakref, trio.Lock and thread-local storage is given by Nathaniel J. Smith <[email protected]>