Skip to content

Instantly share code, notes, and snippets.

Matt Sephton gingerbeardman

View GitHub Profile
DEVICE=$(networksetup -listallhardwareports | grep -A 2 -E "AirPort|Wi-Fi" | grep -m 1 -o -e en[0-9]);
# turn them off...
networksetup -setairportpower $DEVICE Off
./blueutil off
# ...and on again
networksetup -setairportpower $DEVICE On
./blueutil on
View keybase.proof
### Keybase proof
I hereby claim:
* I am gingerbeardman on github.
* I am gingerbeardman ( on keybase.
* I have a public key whose fingerprint is 876C A4D0 3068 5B7F 50C1 96DB A399 461C 25D7 0E39
To claim this, I am signing this object:
gingerbeardman /
Last active Apr 2, 2019
Simple cli tool to use for ephemeral file uploads. Install: curl | sudo tee /usr/local/bin/ && sudo chmod +x /usr/local/bin/
if [ $# -eq 0 ]; then
echo "Usage: FILE\n"
exit 1
gingerbeardman /
Last active Apr 18, 2019 — forked from devster/
Simple cli tool to use Install: curl | sudo tee /usr/local/bin/ && sudo chmod +x /usr/local/bin/
DEFAULT_EXPIRE="14d" # Default to 14 days
if [ $# -eq 0 ]; then
echo "Usage: FILE [DURATION]\n"
echo "Example: path/to/my/file 1w\n"
exit 1
gingerbeardman /
Last active Apr 30, 2018
How to make Fujitsu's ScanSnap software recognise a PDF that you haven't scanned
  1. Instal ExifTool: brew install exiftool
  2. Replace the Creator metadata: exiftool -Creator="ScanSnap Manager #S1300i" *.pdf
gingerbeardman /
Created Jan 1, 2018
Cropping the whole of a multi-page PDF using Preview on macOS X
  1. Open multi-page PDF
  2. Select all pages (Cmd+A with focus in thumbnail sidebar)
  3. Tools > Rectangular Selection
  4. On single page drag to select area to crop
  5. Tools > Crop (or Cmd+K)

All pages are cropped identically!

gingerbeardman / _generate.php
Created Dec 7, 2017
Normalise the size of fonts using the inverse of the Asc+Desc metric
View _generate.php
#!/usr/bin/env php
$dirs = glob("*", GLOB_ONLYDIR);
foreach ($dirs as $folder) {
echo $folder."\n";
$files = glob("$folder/*");
DATE=`date +%Y%m%d%H%M%S`
defaults write "/Users/matt/Projects/Wire Hang/Info.plist" CFBundleVersion -string "$DATE"
cp "Info.plist" "Wire Hang"
cp "icons/Wire Hang Redux.icns" "Wire Hang"
touch "Wire Hang"
xattr -cr "Wire Hang"
codesign -f -s "3rd Party Mac Developer Application: Matt Sephton (A1B234CD5E)" "Wire Hang"
productbuild --component "Wire Hang" /Applications --sign "3rd Party Mac Developer Installer: Matt Sephton (A1B234CD5E)" "Wire Hang Redux.pkg"
spctl -a -v --type install "Wire Hang Redux.pkg"
gingerbeardman / circle-to-circle-collision.phaser.js
Last active Jun 8, 2016
Circle-to-Circle collision test using Phaser JS framework
View circle-to-circle-collision.phaser.js
circleToCircle: function(obj1, obj2) {
return game.physics.arcade.distanceBetween(obj1, obj2) < (obj1.body.width/2 + obj2.body.width/2);
View embedded-tags.php
echo "<pre>";
$subject = "This is a test {pause}3{/pause} for embedded tags. {shake}1.5{/shake} Tada! {wait}keySpace{/wait}\n";
$pattern = "#{([\w]+)}(.*?){/\\1}\s#";
preg_match_all($pattern, $subject, $matches);
$split = preg_split($pattern, $subject);
You can’t perform that action at this time.