Skip to content

Instantly share code, notes, and snippets.

View filevich's full-sized avatar
🥜
deez nuts

JP Filevich filevich

🥜
deez nuts
View GitHub Profile
@filevich
filevich / multi.py
Last active December 15, 2022 05:08
split buffer or range in subranges for a given number of threads
import threading
import time
import random
def thread_function(name, n):
print(f"Thread {name} starting - duration: {n}")
time.sleep(n)
if __name__ == "__main__":
@filevich
filevich / pascal_2_lower_snake_case.py
Created April 21, 2023 06:12
pascal to lower snake case in python
import re
s = lambda txt: re.sub(r'(?<!^)(?=[A-Z])', '_', txt).lower()
# eg: s("FooBarBaz") returns "foo_bar_baz"
@filevich
filevich / example.go
Created February 15, 2024 18:30
go logrotate + verbose stdout example
package main
import (
"flag"
"fmt"
"io"
"log"
"os"
"strconv"