Skip to content

Instantly share code, notes, and snippets.

View noel-friedrich's full-sized avatar
🚂
Hopefully on a train somewhere

Noel Friedrich noel-friedrich

🚂
Hopefully on a train somewhere
View GitHub Profile
@noel-friedrich
noel-friedrich / solve_advent_calendar_using_tsp.py
Last active December 3, 2025 12:40
Solves for an advent calendar that maximises the average (euclidean) distance between consecutive entries, assuming they're placed in a 4x6 grid.
import numpy as np
import math
import matplotlib.pyplot as plt
from ortools.constraint_solver import pywrapcp, routing_enums_pb2
vertices = tuple(range(25))
dummy_vertex = 24
def i_from_xy(x, y):
return y * 6 + x
@noel-friedrich
noel-friedrich / MrBeast-Progressbars-5more.py
Created June 5, 2025 16:01
An export of the ipython notebook used to create more MrBeast progress bar warpings! See https://youtu.be/QuR_3Mar-nI
# %%
import cv2, math, os
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal
import shutil, subprocess
from scipy.io import wavfile
import skimage as ski
@noel-friedrich
noel-friedrich / MrBeast-Progress-Bar-Video-Warping.py
Created May 31, 2025 16:38
Code I used to warp-correct a MrBeast video
import cv2, math, os
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal
import shutil, subprocess
from scipy.io import wavfile
# %%
@noel-friedrich
noel-friedrich / stamp_folding_naive.py
Created May 16, 2025 07:34
a stupid implementation for the stamp folding problem. It's quite inefficient but works!
from enum import Enum
import copy
class FoldDirection(Enum):
Right = "r"
Left = "l"
class FoldingPaper:
def __init__(self, num_segments, perm_arr=None):