Skip to content

Instantly share code, notes, and snippets.

View travm's full-sized avatar
😱

Travis Maynard travm

😱
View GitHub Profile
@travm
travm / gist:97d7366ecd9d2667c7b773632cccebf2
Created May 30, 2025 01:14 — forked from lordastley/gist:5127027
1-bit dithering a video
ffmpeg -i input.mp4 -s hd480 -f image2 img-%4d.png # dump the video to .png images, 480p
for i in *.png; do convert $i -colorspace Rec709Luma pgm:- | pamditherbw -atkinson | pnmtopng > p$i; done; # convert .png images to 1-bit dithered .pngs
ffmpeg -r [orig. framerate] -i pimg-%4d.png -i input.mp4 -map 0:0 -map 1:1 -c:a copy -c:v libx264 -tune stillimage -crf 18 -r 24 lol.mkv
#take dithered png files, original video's audio, make a video with x264, tuned for still images and a copy of the audio. specify frame rate for proper a/v sync
# -map 1:1 maps audio from 2nd input (orig video) to audio of new video. assumes stream 1 is desired audio track. check this.
@travm
travm / cleanEdge-shadertoy.glsl
Created February 13, 2025 16:41 — forked from torcado194/cleanEdge-shadertoy.glsl
cleanEdge, a pixel art upscaling algorithm for clean rotations
/*** MIT LICENSE
Copyright (c) 2022 torcado
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
@travm
travm / catmull-rom.gd
Created August 20, 2024 02:45 — forked from JoelBesada/catmull-rom.gd
Catmull-Rom Spline in GDScript
func catmull_rom_spline(
_points: Array, resolution: int = 10, extrapolate_end_points = true
) -> PackedVector2Array:
var points = _points.duplicate()
if extrapolate_end_points:
points.insert(0, points[0] - (points[1] - points[0]))
points.append(points[-1] + (points[-1] - points[-2]))
var smooth_points := PackedVector2Array()
if points.size() < 4:
@travm
travm / EN_iOS_Godot_no_paid_account.md
Created March 3, 2020 03:22
Build and Run Godot Games on iOS without a Paid Apple Dev Account

Godot Games on iOS without an Apple Paid Developer Account

Prerequist

  • A Mac and some iDevice (ios 8 +) if you want to try it physically
  • Xcode and the common tools (run it once)
  • Godot Engine 3.1.1 (+?) (Will probably work on other version but it's the version I tried that)

Steps

  1. Create a Personal Team with your Standard Apple account and Generate a Certificate for your Computer. (Google it)
@travm
travm / bob-ross.gpl
Created September 3, 2019 02:54
Bob Ross Color Palette (GIMP)
GIMP Palette
# Name: Bob Ross
# Colors: 13
0 0 0 Midnight Black (#000000)
12 0 64 Phthalo Blue (#0C0040)
2 30 68 Prussion Blue (#021E44)
34 27 21 Van Dyke Brown (#221B15)
78 21 0 Alizarin Crimson (#4E1500)
10 52 16 Sap Green (#0A3410)
16 46 60 Phthalo Green (#102E3C)
@travm
travm / timelapse.md
Created August 16, 2018 14:21 — forked from alexellis/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@travm
travm / boi-controller-mapping.md
Last active November 11, 2017 23:49
The Binding of Isaac: Rebirth - Controller Mapping Order

The Binding of Isaac: Rebirth Controller Mapping

The controller mapping labels for the game are currently broken (they are not visible) so, this is the order of the control mappings for those who are experiencing this problematic issue.

I was unable to figure out the items marked [Unknown], so if you know what actions those mappings correspond to, please leave a comment and I will update them.

  1. Move Up
  2. Move Down
  3. Move Left
  4. Move Right
  5. Shoot Up
@travm
travm / gulpfile.js
Created April 5, 2017 13:25
Gulp, Browserify, & Babel Example
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
gulp.task('js', function () {
return browserify('src/main.js')
.transform('babelify', {presets: ['env']})
.bundle()
@travm
travm / writing-gulpfiles-with-es6-and-babel-6.md
Last active January 7, 2016 16:16
Writing Gulpfiles with ES6/2015 & Babel 6.0

Here's a quick tip to start writing your gulpfiles in ES2015 with Babel 6.0.

1. Rename Your Gulpfile

mv gulpfile.js gulpfile.babel.js

2. Install Babel Core & ES2015 Preset

npm install --save-dev babel-core babel-preset-es2015
@travm
travm / boi-easter-egg-seeds
Last active November 3, 2015 18:32
The Binding of Isaac: Rebirth/Afterbirth Easter Egg Seeds
# The Binding of Isaac: Rebirth/Afterbirth Easter Egg Seeds
30M1
N1TS
ALLE
GR0
ANDA
NTE