Skip to content

Instantly share code, notes, and snippets.

View woudsma's full-sized avatar

Tjerk Woudsma woudsma

View GitHub Profile
woudsma /
Last active April 11, 2023 21:27
Convert samples for JoMoX Alpha Base compatibility with FFmpeg

Converting samples before import to JoMoX Alpha Base

Samples need to be 16 bit / 48kHz mono wav files.


  • Zsh (run zsh --version to check if it's installed already)
  • FFmpeg (brew install ffmpeg)

This guide is for UNIX (MacOS or Linux) users, the process would be similar on Windows machines with FFmpeg though. The required FFmpeg options are:

ffmpeg -i $INPUT -acodec pcm_s16le -ac 1 -ar 48000 $OUTPUT
woudsma / dokku-dockerfile-github-actions-deploy.yml
Last active July 24, 2021 14:47
Deploy project with Dockerfile to Dokku using Github Actions and Github Container Registry ( Deploy either staging or production based on branch.
# Example repository with Dockerfile and NGINX config:
name: Deploy to Dokku
- closed
- develop
woudsma /
Last active July 10, 2020 18:35
gitignore command line function
function gitignore() {
echo "--> Fetching: $GITIGNORE_IO_URL"
echo "--> Writing: $GITIGNORE_FILE"
### my-script — does one thing well
### Usage:
### my-script <input> <output>
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
woudsma /
Last active September 17, 2019 19:40
static video to realtime live stream to twitch with ffmpeg - quick n dirty
# Quick and dirty script for streaming a video file to Twitch (as if it were live)
# Requirements: ffmpeg (
# Copy-paste the function and call it in your command line
# Or add the function to ~/.bash_profile, ~/.zshrc, ..etc.
# Usage:
# Example:

Dokku ACL plugin

# Dokku host
dokku plugin:install acl

dokku ssh-keys:add guest
dokku ssh-keys:list

mkdir ~dokku/.dokkurc
echo "export DOKKU_ACL_ALLOW_COMMAND_LINE=1" >> ~dokku/.dokkurc/acl
import math
from bigfloat import *
class LazyCartesianProduct:
def __init__(self, sets, context):
self.sets = sets
self.context = context
self.divs = []
self.mods = []
self.maxSize = BigFloat.exact(1)
woudsma /
Last active November 1, 2022 05:09
Retrain a MobileNet model for the web with TensorFlow for Poets and TensorFlow.js

Retrain a MobileNet model and use it in the browser with TensorFlow.js


Combining TensorFlow for Poets and TensorFlow.js.
Retrain a MobileNet V1 or V2 model on your own dataset using the CPU only.
I'm using a MacBook Pro without Nvidia GPU.

MobileNets can be used for image classification. This guide shows the steps I took to retrain a MobileNet on a custom dataset, and how to convert and use the retrained model in the browser using TensorFlow.js. The total time to set up, retrain the model and use it in the browser can take less than 30 minutes (depending on the size of your dataset).

Example app - HTML/JS and a retrained MobileNet V1/V2 model.

echo "Compositing files and ramping up video framerate"
echo "================================================"
rm -rf render && mkdir render
for file in *.mov; do
# Ramp up video framerate, add audio
ffmpeg \
woudsma /
Last active February 19, 2018 12:54
Javascript k-d-tree
npm i k-d-tree
const kd = require('k-d-tree')

const data = new Array(1000)
  .map(() => ({
 type: "Point",