Skip to content

Instantly share code, notes, and snippets.

View P403n1x87's full-sized avatar
⚒️
Tinkering

Gabriele N. Tornetta P403n1x87

⚒️
Tinkering
View GitHub Profile
@P403n1x87
P403n1x87 / wordle.py
Last active January 4, 2022 15:27
Wordle solver
import typing as _t
from collections import defaultdict
from enum import Enum
from random import choice
class TileColor(Enum):
GRAY = 0
YELLOW = 1
GREEN = 2
@P403n1x87
P403n1x87 / deps.py
Last active October 9, 2022 11:17
Install Kodi Python plugin dependencies from PyPI using pip
# Use as
#
# import deps
#
# deps.install(dict(requests="2.28.1"))
#
import json
import os
import site
@P403n1x87
P403n1x87 / README.md
Created October 5, 2022 09:45
gevent patch poc

When run as

python -m main

the expected output is

[abu] patched dolly
[main] Abu

That's because we are patching the dolly module and the Dolly class is now the Abu class.

@P403n1x87
P403n1x87 / map.py
Created November 7, 2022 12:25
Elements of a free module over a ring
class Map(dict):
"""Element of a free module over a ring."""
def __add__(self, other):
m = Map(self)
for k, v in other.items():
n = m.setdefault(k, v.__class__()) + v
if not n and k in m:
del m[k]
continue
@P403n1x87
P403n1x87 / Makefile
Created October 14, 2024 09:21 — forked from JCash/Makefile
How to print the correct, offending callstack
CXXFLAGS := \
-O0 -g -Wall \
-march=native -mtune=native \
-I/usr/local/opt/libunwind-headers/include
ifeq ($(shell uname), Linux)
LDFLAGS := -lunwind
endif
TARGETS := \