Skip to content

Instantly share code, notes, and snippets.

View catinwarmhands's full-sized avatar
😎
Your brain gets smart, but your head gets dumb

Lev Buimistriuk catinwarmhands

😎
Your brain gets smart, but your head gets dumb
View GitHub Profile
taskkill /f /im wslservice.exe
wsl --shutdown
powershell -command "Restart-Service LxssManager"
@catinwarmhands
catinwarmhands / docker-compose.yaml
Created March 15, 2023 11:55
Zookeeper + Kafka + Kafdrop + Debezium Connect
version: "3"
services:
zookeeper:
image: bitnami/zookeeper
ports:
- 2181:2181
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
@catinwarmhands
catinwarmhands / docker-compose.yaml
Created March 15, 2023 10:00
Zookeeper + Kafka + Kafdrop
version: "3"
services:
zookeeper:
image: bitnami/zookeeper
ports:
- 2181:2181
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
import functools
import time
def retry(n=3, sleep=1):
def decorate(f):
@functools.wraps(f)
def applicator(*args, **kwargs):
i = 0
while True:
i += 1
@catinwarmhands
catinwarmhands / collage.py
Last active February 2, 2023 18:50
Simple script to create grid collages of images using pillow
import os
import math
from tqdm import tqdm
from PIL import Image
def list_files(path):
return list(filter(os.path.isfile, [os.path.join(path, f) for f in os.listdir(path)]))
@catinwarmhands
catinwarmhands / fnv_hash.py
Last active June 14, 2024 08:19
fnv_hash function from impala, implemented in python
import sys
import struct
def get_byte(b): # python 2
if sys.version_info[0] == 3:
return b
else:
return ord(b)
@catinwarmhands
catinwarmhands / webpconverter.py
Created June 24, 2020 13:47
Convert all animated webp in folder to animated gifs
import os
import sys
import webp
from PIL import Image
from send2trash import send2trash
parent_dir = sys.argv[1]
_, _, filenames = next(os.walk(parent_dir))
@catinwarmhands
catinwarmhands / main.py
Created December 3, 2019 21:42
Метод Шермана—Лемана и Алгоритм Конягина—Померанса
from math import sqrt, floor, ceil, gcd, log
import random
from tqdm import tqdm
from collections import Counter
def inclusive_range(start, stop, step=1):
return range(start, (stop + 1) if step >= 0 else (stop - 1), step)
def prod(l):
p = 1
@catinwarmhands
catinwarmhands / fht.nb
Created September 23, 2019 09:27
Fast Haar Transform
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 11.2' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
@catinwarmhands
catinwarmhands / Course.py
Last active June 9, 2019 09:32
Course work about CIFAR-10 + Keras (0.9 accuracy)
# Подключаем библиотеки
import keras
print("keras version:", keras.__version__)
import os
import time
import numpy as np
import matplotlib.pyplot as plt
import random
from tqdm.autonotebook import tqdm as progressbar