Skip to content

Instantly share code, notes, and snippets.

View Jezzamonn's full-sized avatar

Jez Swanson Jezzamonn

View GitHub Profile
import numpy as np
import pandas as pd
points = pd.read_csv('hand500.csv', header=None)
points_complex = points[0] + 1j * points[1]
z = np.fft.fft(points_complex)
amp = np.abs(z)
phase = np.angle(z)
freq = np.fft.fftfreq(len(z))
# zero out base amplitude to center it around zero
@Jezzamonn
Jezzamonn / ffmpeg_commands.sh
Last active November 15, 2019 03:00
Clever image/video editing commands
# Resize pixel art images (permanently changes source images)
mogrify -filter point -resize 200% image*
# Take a vertical image and make it square with blurry letterbox things. Uses clever filter graph stuff
ffmpeg -i input.mp4 -vf 'split [original][copy]; [copy] crop=ih*9/16:ih:iw/2-ow/2:0, scale=1280:2282, gblur=sigma=20[blurred]; [blurred][original]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2' output.mp4
# Take a bunch of images and turn them into a gif with a good palette
# (see https://www.ffmpeg.org/ffmpeg-formats.html#image2-1 for the format of $frame_pattern)
ffmpeg -f image2 -i "$frame_pattern" -filter_complex "[0:v] palettegen" -y "$palette"
ffmpeg -f image2 -i "$frame_pattern" -framerate 30 -i $palette -filter_complex "[0:v][1:v] paletteuse" -y "${out_filename}"
while [ 1 ];do vardate=$(date +%d\-%m\-%Y\_%H.%M.%S); screencapture -t jpg -x ~/Desktop/screencap/$vardate.jpg; sleep 30; done
@Jezzamonn
Jezzamonn / LDRules.md
Last active April 13, 2017 15:46
Ludum Dare rules page ported over to markdown

Ludum Dare: The Rules

Ludum Dare is an event where you create a game from scratch in a weekend based on a theme.

Themes are suggested and chosen by the community. Theme Suggestions are accepted starting 5 weeks before the event. Theme Voting kicks off 2 weeks before the event.

The theme is revealed at the start of the event.

Ludum Dare games are submitted to 1 of 2 categories: the Jam or the Compo.