Skip to content

Instantly share code, notes, and snippets.

View maxfire2008's full-sized avatar

Max Burgess maxfire2008

View GitHub Profile
import os
import difflib
from collections import defaultdict
def find_xxh3_files(directory):
xxh3_files = []
for root, _, files in os.walk(directory):
for file in files:
if file.endswith('.xxh3'):
xxh3_files.append(os.path.join(root, file))
@maxfire2008
maxfire2008 / embedsubs.ps1
Created October 20, 2022 11:32
embed subtitles
ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4
@maxfire2008
maxfire2008 / fixdate.ps1
Created October 15, 2022 01:50
Fix date of video from sony a7 (may work for more cameras)
(Get-Item "00000.MTS").CreationTime=(Get-Item "00000.MTS").LastWriteTime
@maxfire2008
maxfire2008 / fr24_kml_to_gpx.bat
Created October 6, 2022 09:07
convert Flightradar24 KML to GPX
REM Credit to https://forums.garmin.com/apps-software/mac-windows-software/f/virb-edit-mac/116005/flightradar-24-fr24-klm-to-gpx-files
REM But garmin keeps messing with their forum so I fear it may again go somewhere else.
"C:\Program Files\GPSBabel\gpsbabel.exe" -w -i kml -f INFILE.kml -x nuketypes,tracks -x transform,trk=wpt,del -o GPX -F OUTFILE.gpx
@maxfire2008
maxfire2008 / greedy_pig.py
Created September 1, 2022 02:39
I made this game in 2020 for a python course in Grade 6 - I published because we played this in maths today (1 Sep 2022) - so I went digging
#!/usr/bin/python3
import random, time
min = 1
max = 6
pa = 0
pb = 0
startdone = 0
gamedone = 0
read = 'n'
@maxfire2008
maxfire2008 / fd.ps1
Last active August 9, 2022 22:45
Makes flask much much much easier to use with a powershell script
#!/usr/bin/pwsh
param (
[string]$FlaskApp = "app.py",
[string]$FlaskEnvironment = "development",
[string]$IPHost = "127.0.0.1",
[string]$Port = 5000
)
#set env var "FLASK_APP" to $args[0]
#set env var "FLASK_ENV" to $args[1]
@maxfire2008
maxfire2008 / rruleset_json.py
Last active June 11, 2024 11:16
Convert rruleset to json and back
# rruleset_json.py by Max 2022
# To the extent possible under law, the person who associated CC0 with
# rruleset_json.py has waived all copyright and related or neighboring rights
# to rruleset_json.py.
# You should have received a copy of the CC0 legalcode along with this
# work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# https://gist.github.com/maxfire2008/096fd5f55c9d79a11d41769d58e8bca1
@maxfire2008
maxfire2008 / conversion_formula_brute_force.py
Last active March 1, 2022 00:11
Brute force a conversion formula for page numbers between 2 editions of a book
mapping = [
["Spring 1941",40,38],
["Part 3",54,53],
["My day",44,43],
["Fall 1941",50,49],
["Bombs!",176,192],
]
def difference(a,b):
if a > b:
@maxfire2008
maxfire2008 / blank_finder_brute_force.py
Last active March 1, 2022 00:04
Brute forces a math sum with multiple blanks
import itertools
side_a = "(a+b)/c==d"
v = [-9,-2,8,-7]
for p in itertools.permutations(v,len(v)):
side_a_m = side_a
for i,v in enumerate(p):
side_a_m=side_a_m.replace(chr(i+97),"("+str(v)+")")
def any_order(a,b,order):
c=a
for item in order:
if item == "+":
c+=b
elif item == "*":
c*=b
elif item == "-":
c-=b
elif item == "/":