This gist has been migrated to a new repository, https://github.com/thegamecracks/joblin!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import difflib | |
import math | |
import random | |
DIGITS = { | |
1: "ichi", | |
2: "ni", | |
3: "san", | |
4: "yon", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from tkinter import StringVar, Text, Tk | |
from tkinter.ttk import Entry, Frame, Label | |
from typing import Sequence | |
if sys.platform == "win32": | |
from ctypes import windll | |
windll.shcore.SetProcessDpiAwareness(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from concurrent.futures import Future, InvalidStateError, ThreadPoolExecutor | |
from contextlib import suppress | |
from typing import Any, Callable, TypeVar | |
T = TypeVar("T") | |
R_co = TypeVar("R_co", covariant=True) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
objects.inv v2 Syntax Reference: | |
https://sphobjinv.readthedocs.io/en/stable/syntax.html | |
Python Discord Bot Reference: | |
https://github.com/python-discord/bot/blob/main/bot/exts/info/doc/_inventory_parser.py | |
""" | |
import re | |
import zlib | |
from dataclasses import dataclass | |
from typing import Generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from tkinter import Event, Tk | |
from tkinter.ttk import Frame, Label | |
if sys.platform == "win32": | |
from ctypes import windll | |
windll.shcore.SetProcessDpiAwareness(2) | |
LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada ipsum enim, feugiat venenatis sapien tempus et. Morbi auctor egestas metus vel faucibus. Nullam in nunc nisi. Maecenas eget sagittis ante. Sed ut turpis turpis. Morbi suscipit massa ac efficitur iaculis. Suspendisse risus nisi, tempor non pulvinar sed, vehicula a sapien. Pellentesque iaculis ligula sed sapien faucibus, eget mollis magna volutpat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Morbi porttitor luctus tellus, nec tincidunt lacus. Nunc dui eros, laoreet sed pretium id, porttitor eget nunc." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires Python>=3.11 | |
import asyncio | |
import contextlib | |
import threading | |
import unittest | |
class Event(threading.Event): # TODO: any better name? | |
"""A thread-safe event compatible with asyncio.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Dependencies: | |
Pillow>=10.3.0 | |
usage: composite.py [-h] [-s SCALE] [-o OFFSET] image | |
Create a composite of the given image and display it. | |
The window can be clicked to toggle it as an overlay. | |
You can also right click it to save the image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Converts resistor parameters into their corrresponding color bands.""" | |
import argparse | |
from decimal import Decimal | |
# list of colors ordered by their corresponding digit (0-9) | |
DIGIT_BANDS = [ | |
"black", | |
"brown", | |
"red", |
This gist has been migrated to a repository: https://github.com/thegamecracks/iconify
NewerOlder