Skip to content

Instantly share code, notes, and snippets.

View TimothyLoyer's full-sized avatar
👨‍🚀
my brain is in the stars

Tim Loyer TimothyLoyer

👨‍🚀
my brain is in the stars
View GitHub Profile
@TimothyLoyer
TimothyLoyer / sn-convert-img
Last active May 8, 2023 16:36
Bash script to convert images for use with Supernote A6X and A5X
#!/usr/bin/bash
################################################################################
#
# Description:
# Convert images for compatibility with the Supernote A6X and A5X.
#
# If an original image's size exceeds the ratio required to be compatible
# with the Supernote, it will automatically be centered and cropped.
#
# Usage:
@TimothyLoyer
TimothyLoyer / main.py
Created December 1, 2022 15:01
Advent of Code 2022 - Day 1
"""Advent of Code 2022: Day 1"""
def get_input(path):
with open(path) as i:
return i.read()
def get_input_lines(path):
i = get_input(path)
@TimothyLoyer
TimothyLoyer / squashmigrations.py
Last active July 15, 2024 13:42
Override of Django's squashmigrations management command to allow improved optimization (with increased risk!!!)
"""Override of Django's squashmigrations management command to allow improved optimization (with increased risk!!!)
# Source
Copied from the squashmigrations management command in Django 4.2.x:
https://github.com/django/django/blob/c5d196a6/django/core/management/commands/squashmigrations.py
# Use
The `--force-defer` option triggers the new behavior:
`python manage.py mysquashmigrations --force-defer`