Skip to content

Instantly share code, notes, and snippets.

View evantbyrne's full-sized avatar

Evan Byrne evantbyrne

View GitHub Profile
@evantbyrne
evantbyrne / command.sh
Created November 12, 2018 19:42
Dump Wagtail data
python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 4
@evantbyrne
evantbyrne / command.sh
Created July 18, 2018 17:11
Restore Heroku PostgreSQL Dump
heroku pg:backups:restore <URL to compressed dump> DATABASE_URL --app <APP>
@evantbyrne
evantbyrne / command.sh
Created June 15, 2018 19:39
Remove dangling docker images
docker rmi $(docker images -q -f dangling=true)
@evantbyrne
evantbyrne / app.js
Last active January 30, 2018 17:37
DOM ready
// Example using the module.
import domready from "./domready.js";
domready(function() {
//...
});
@evantbyrne
evantbyrne / command.sh
Last active September 22, 2017 14:18
Laravel reload seed classes
composer dump-autoload -o
@evantbyrne
evantbyrne / command.sh
Created April 1, 2017 20:59
ffmpeg cut video time
# Cut five seconds off beginning
ffmpeg -i original.mkv -strict experimental -c:v copy -c:a copy -ss 00:00:05 cut.mkv
# Cut to ten seconds in length, starting at five seconds (5-15s)
ffmpeg -i original.mkv -strict experimental -c:v copy -c:a copy -ss 00:00:05 -t 00:00:10 cut.mkv
# Cut everything before five seconds, cut everything after eight seconds (5-8s)
ffmpeg -i original.mkv -strict experimental -c:v copy -c:a copy -ss 00:00:05 -to 00:00:08 cut.mkv
@evantbyrne
evantbyrne / command.sh
Last active September 22, 2017 14:20
ffmpeg .mkv to .mp4 with AAC audio
ffmpeg -i video.mkv -strict experimental -c:v copy -c:a aac -b:a 192k video.mp4
@evantbyrne
evantbyrne / mp4togif.sh
Last active April 1, 2017 21:09
ffmpeg convert .mp4 to .gif
ffmpeg -i original.mp4 -vf scale=-1:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - gif:- | convert -layers Optimize - result.gif
@evantbyrne
evantbyrne / gist:d589cbcb46ea54610a74
Last active October 26, 2015 21:25
Use MAMP mysql.sock
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
@evantbyrne
evantbyrne / main.go
Created September 5, 2015 18:48
How to use go generate
//go:generate echo Generate
package main
import "fmt"
func main() {
fmt.Println("Main")
}