Skip to content

Instantly share code, notes, and snippets.

View alexflint's full-sized avatar
💭
Watching Soryu Forall videos on youtube

Kōshin Alex Flint alexflint

💭
Watching Soryu Forall videos on youtube
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexflint
alexflint / make_video.py
Last active August 19, 2025 17:13
Create a video from a sequence of images (or PDFs) in python (using ffmpeg internally)
import os
import sys
import tempfile
import argparse
import subprocess
NATURAL_FPS = 30.
# Formats convertible by imagemagick:
CONVERTIBLE_EXTENSIONS = ['png', 'jpeg', 'jpg', 'pdf', 'pgm', 'bmp']
@alexflint
alexflint / worklog.py
Created March 13, 2014 21:30
Command line tool to copy directory snapshots to a timestamped worklog database
#!/usr/local/bin/python
import os
import sys
import shutil
import datetime
WORKLOG_DIR = 'Worklogs'
datetime_fmt = '%Y %m %d %I.%M%p' # eg: "2014 01 03 11.45AM"
@alexflint
alexflint / gist:8403817
Created January 13, 2014 17:01
Test for images that are too dark
uint8_t ComputeMax(const uint8_t* image, size_t width, size_t height, size_t stride) {
uint8_t m = 0;
for (int i = 0; i < height; i++) {
const uint8_t* p = &image[i*stride];
for (int j = 0; j < width; j++) {
if (*p > m) {
m = *p;
}
p++;
@alexflint
alexflint / gist:4313894
Created December 16, 2012 22:55
A google apps script that reminds me that I have a package delivery. It schedules an SMS for the time I arrive home (about 6:30pm) on any day when I receive an email with a certain label.
/**
* Author: [email protected]
* Date: December 16, 2012
*
* A google apps script that reminds me that I have a package delivery. It
* schedules an SMS for the time I arrive home (about 6:30pm) on any day when
* I receive an email with a certain label.
*/
////////////////////////////////////////////////////////////////////////////////