Skip to content

Instantly share code, notes, and snippets.

View Dotrar's full-sized avatar
🌴
Having fun

Dre Westcook Dotrar

🌴
Having fun
View GitHub Profile
#!/usr/bin/env python3
from __future__ import annotations
import dataclasses
import itertools
import math
import os
import time
from functools import cmp_to_key
from typing import Callable
#!/usr/bin/env python3
from __future__ import annotations
import dataclasses
import itertools
import math
import os
import time
from functools import cmp_to_key
from typing import Callable
#!/usr/bin/env python3
from __future__ import annotations
import dataclasses
import math
import os
import time
from functools import cmp_to_key
from typing import Callable
#!/usr/bin/env python3
from __future__ import annotations
import dataclasses
import math
import os
import time
from typing import Callable
import aocd
#!/usr/bin/env python3
from __future__ import annotations
import dataclasses
from textwrap import dedent
from typing import Callable
import aocd
import parse
#!/usr/bin/env python3
from __future__ import annotations
import aocd
test_data = """
addx 15
addx -11
addx 6
addx -3
@Dotrar
Dotrar / conftest.py
Last active October 19, 2022 01:47
Pytest Reloader
"""
Pytest reloader:
author: Dre
place this file in your source directory (ie: src/confteset.py) which will auto-load by pytest.
when running pytests with the --pdb option, when leaving the debugger from test-failure, this plugin will re-load the
test and run it to see if any code changes have improved.
currently only reloads the test.
;; naming conventions:
;; bitstring = "01001" a string of bits
;; binary = (#\0 #\1 #\1) a list of chars representing bits
;; x-list = (x x x) a list of whatever
;; bit = generally just one item, like #\0
(defun transpose (list-of-list)
"matrix transpose"
(apply #'mapcar #'list list-of-list))
@Dotrar
Dotrar / example.py
Created September 19, 2018 07:47
gpio on
# use this code to turn the LED on
from gpiozero import LED()
LED(3).on()