Skip to content

Instantly share code, notes, and snippets.

View timakro's full-sized avatar

Tim Schumacher timakro

  • Darmstadt, Germany
View GitHub Profile
@timakro
timakro / Save GIFs from within mpv.md
Last active July 21, 2023 16:41
Save GIFs from within mpv
  • Based on mpvs A-B loop feature which is bound to the l key by default
  • Depends only on ffmpeg
  • Uses the palettegen feature of ffmpeg for better colors
  • The frame rate of the GIF will be between 10 and 20 FPS and is determined by halving the source frame rate repeatedly
  • The GIF is 480 pixels wide (this can be changed easily)
  • Tested on Linux
@timakro
timakro / rot_n_cracker.py
Last active November 13, 2020 21:56
Probabilistic ROT-n cracker
#!/usr/bin/python
# wordlist.txt is a tab-delimited word frequency list.
# A list for the German language can be found here:
# https://github.com/gambolputty/dewiki-wordrank
import sys
import re
from collections import Counter
from string import ascii_lowercase as letters
@timakro
timakro / bouncy_pi.py
Created January 13, 2019 19:45
Caculate Pi using a physics simulation of elastic collisions https://www.youtube.com/watch?v=HEfHFsfGXjs
#!/usr/bin/python3
import math
DIGITS = 4
class Body:
def __init__(self, pos, vel, mass):
self.pos = float(pos)
self.vel = float(vel)