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
Singleton = type("Singleton", (), {"instance": None, "__new__": lambda cls: (cls.instance if cls.instance else (self := super(Singleton, cls).__new__(cls), setattr(cls, "instance", self))[0])}) |
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
# I haven't used numpy at all outside of tutorials years ago. They may have better perf | |
# instead of cropping but I don't really care to try that out. My funky part is the `map` | |
# which lazily gets each item (the thing which doesn't even need to be lazy, the cropping | |
# really should. | |
import functools | |
import operator | |
from PIL import Image | |
def valid_input( |
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
:root { | |
--brand-260: hsl(235, 86.2%, 88.6%); | |
--brand-500-hsl: 235 85.6% 64.7%; | |
--primary-230: hsl(210, 9.1%, 87.1%); | |
--primary-560: hsl(225, 6.3%, 23.5%); | |
--primary-600: hsl(223, 6.7%, 20.6%); | |
--primary-630: hsl(220, 6.5%, 18.0%); | |
--primary-700: hsl(225, 6.3%, 12.5%); | |
--primary-730: hsl(225, 7.1%, 11%); | |
--primary-860-hsl: 240 7.7% 2.5%; |
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 collections.abc import Callable | |
from typing import Any, Concatenate, ParamSpec, TypeVar | |
from typing_extensions import reveal_type | |
P = ParamSpec("P") | |
T = TypeVar("T") | |
Call = Callable[P, Any] |
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
# This file contains common pin mappings for the BIGTREETECH SKR mini | |
# E3 v1.2. To use this config, the firmware should be compiled for the | |
# STM32F103 with a "28KiB bootloader" and USB communication. Also, | |
# select "Enable extra low-level configuration options" and configure | |
# "GPIO pins to set at micro-controller startup" to "!PC13". | |
# The "make flash" command does not work on the SKR mini E3. Instead, | |
# after running "make", copy the generated "out/klipper.bin" file to a | |
# file named "firmware.bin" on an SD card and then restart the SKR | |
# mini E3 with that SD card. |
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
(lambda a: lambda v: a(a, v))(lambda f, value: f(f, value * 2))(initial) |
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
print(int(((lambda a: lambda v: a(a, v))(lambda f, stuff: f(f, [[digits for digits in stuff[0] if digits[stuff[1]] == (max({v[stuff[1]] for v in stuff[0]}, key=[v[stuff[1]] for v in stuff[0]].count) if [v[stuff[1]] for v in stuff[0]].count("0") != [v[stuff[1]] for v in stuff[0]].count("1") else "1")], stuff[1] + 1]) if len([digits for digits in stuff[0]if digits[stuff[1]] == (max({v[stuff[1]] for v in stuff[0]}, key=[v[stuff[1]] for v in stuff[0]].count) if [v[stuff[1]] for v in stuff[0]].count("0") != [v[stuff[1]] for v in stuff[0]].count("1") else "1")]) != 0 and stuff[1] < 12 else stuff[0]))([list(open("input3.txt").readlines()), 0])[0], base=2) * int(((lambda a: lambda v: a(a, v))(lambda f, stuff: f(f, [[digits for digits in stuff[0] if digits[stuff[1]] == (min({v[stuff[1]] for v in stuff[0]}, key=[v[stuff[1]] for v in stuff[0]].count) if [v[stuff[1]] for v in stuff[0]].count("0") != [v[stuff[1]] for v in stuff[0]].count("1") else "0")], stuff[1] + 1]) if len([digits for digits in stuff[0] if digits[stuff |