Skip to content

Instantly share code, notes, and snippets.

View t-richards's full-sized avatar

Tom Richards t-richards

View GitHub Profile
@t-richards
t-richards / optim
Last active August 29, 2015 14:04
Wrapper for jpegoptim: Strips all markers from output file, force-overwrites original file.
#!/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 / keybase.md
Created August 19, 2014 13:12
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 / crush
Last active July 31, 2017 20:17
Wrapper for pngcrush: removes almost all chunks, overwrites original file.
#!/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"
/* ==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
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'pathname'
require 'tempfile'
def ffmpeg(*args)
system('ffmpeg', *args)
end