Skip to content

Instantly share code, notes, and snippets.

@allexkap
allexkap / vintage.yaml
Last active March 14, 2026 15:59
Vintage Story Server
services:
vintagestory:
container_name: vintagestory
image: mcr.microsoft.com/dotnet/runtime:8.0
ports:
- "42420:42420"
volumes:
- ./server:/var/vintagestory/server:ro
# GENERAL OPTIONS
--abort-on-error
# NETWORK OPTIONS
#--proxy URL
# GEO-RESTRICTION
# VIDEO SELECTION
--download-archive videos.log
import keyboard
hold = False
while True:
keyboard.wait('x', suppress=True)
if hold:
keyboard.release('x')
else:
keyboard.press('x')
hold = not hold
names = {} # from https://github.com/Raven-SL/ru-pnames-list
for name in open('names').read().lower().split():
ch = name[0]
if ch in names:
names[ch].add(name)
else:
names[ch] = set((name,))
out, err = [], []
text = input()
@allexkap
allexkap / fix.sh
Created December 29, 2023 14:41
Black quotes fix
sed -i 's/orig_quote == \'"\'/orig_quote != \'"\'/' ./src/black/strings.py
# not A = A | A
# A and B = (A|B) | (A|B)
# A or B = (A|A) | (B|B)
# A -> B = A | (A|B)
# A xor B = (A|(A|B)) | (B|(A|B))
class L:
def __init__(self, val):
self.val = bool(val)
def repeat(count):
def dec(fun):
def res(*args, **kwargs):
for _ in range(count):
fun(*args, **kwargs)
return res
return dec
@repeat(10)