Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Richards t-richards

View GitHub Profile
View high-quality-gif
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'pathname'
require 'tempfile'
def ffmpeg(*args)
system('ffmpeg', *args)
end
View square-corners.user.css
/* ==UserStyle==
@name Square Corners
@namespace github.com/openstyles/stylus
@version 1.0.8
@license unlicense
@preprocessor default
==/UserStyle== */
/**
* Source: https://gist.github.com/t-richards/aa3239fe1f6b97d64c4153460eab42e1
View git-localmerge
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage: git localmerge <branch_name>"
exit
fi
current_branch=$(git rev-parse --abbrev-ref HEAD)
merge_branch="$1"
View keybase.md

Keybase proof

I hereby claim:

  • I am t-richards on github.
  • I am trichards (https://keybase.io/trichards) on keybase.
  • I have a public key whose fingerprint is 4B94 E32A 6B31 08B5 6F1C 5E9A 0E21 58D9 187E F7AF

To claim this, I am signing this object:

@t-richards
t-richards / optim
Last active Aug 29, 2015
Wrapper for jpegoptim: Strips all markers from output file, force-overwrites original file.
View optim
#!/usr/bin/env bash
if [ $# -eq 0 ]
then
echo "Usage: optim <jpegfile(s)>"
exit
fi
for img in "$@"
do
jpegoptim -f --strip-all "$img"
@t-richards
t-richards / crush
Last active Jul 31, 2017
Wrapper for pngcrush: removes almost all chunks, overwrites original file.
View crush
#!/usr/bin/env bash
if [ $# -eq 0 ]
then
echo "Usage: crush <pngfile(s)>"
exit
fi
for img in "$@"
do
pngcrush -force -rem allb -reduce -brute "$img" "${img%*.}crush.png"