This file contains hidden or 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 multiprocessing import Process, Queue | |
| from urllib.parse import urlparse, urlunparse, urlencode, parse_qs | |
| import os | |
| import random | |
| import time | |
| class TwitchAuthError(Exception): | |
| pass |
This file contains hidden or 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 contextlib import contextmanager | |
| import time | |
| import random | |
| def find_two_slow(lst, target): | |
| result = set() | |
| for a in lst: | |
| for b in lst: | |
| if a + b == target: |
This file contains hidden or 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 PIL import Image | |
| import numpy as np | |
| def ease_in_out_quad(t): | |
| return t * t * (3.0 - 2.0 * t) | |
| def find_coeffs(pa, pb): |
This file contains hidden or 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 | |
| import asyncio | |
| from textual.app import App, ComposeResult | |
| from textual import events | |
| from textual.widgets import Header, Footer, Input, TextLog | |
| class Prompt(Input): | |
| app: 'Terminal' |
This file contains hidden or 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 typing import Callable, Any | |
| from threading import Thread | |
| from concurrent.futures import Future | |
| class ReturnThread(Thread): | |
| _target: Callable | |
| _args: tuple[Any, ...] | |
| _kwargs: dict[str, Any] | |
| _fut: Future |
This file contains hidden or 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 itertools import chain | |
| import sys | |
| from PIL import Image | |
| # Connler's Cool Content Canvas | |
| COLORS = { | |
| 0: (0, 0, 0), # 000000 | |
| 1: (34, 34, 34), # 222222 | |
| 2: (85, 85, 85), # 555555 | |
| 3: (136, 136, 136), # 888888 |
This file contains hidden or 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 typing import TypeAlias, Type | |
| import pygame | |
| import sys | |
| StateDict: TypeAlias = 'dict[str, StateBase | Type[StateBase]]' | |
| class StateMachine: | |
| """Handles all the states and delegates to the correct one.""" | |
| screen: pygame.Surface |
This file contains hidden or 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 multiprocessing import Process, Queue | |
| from urllib.parse import urlencode | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| def run_local_app(q: Queue, state: str): | |
| from flask import Flask, request |
This file contains hidden or 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 struct | |
| import os | |
| import hashlib | |
| def read_dsf(filename): | |
| size = os.stat(filename).st_size | |
| footer_start = size - 16 # 16 byte (128bit) for md5 hash | |
| digest = hashlib.md5() | |
| with open(filename, 'rb') as f: |
This file contains hidden or 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 ast | |
| class NodeVisitor(ast.NodeVisitor): | |
| allowed = { | |
| ast.Add, ast.Sub, | |
| ast.Mult, ast.Div, | |
| ast.FloorDiv, ast.Mod, | |
| ast.Pow, ast.BitXor, | |
| ast.USub, ast.UAdd, |