Skip to content

Instantly share code, notes, and snippets.

View jamesrampton's full-sized avatar
🦀

James Rampton jamesrampton

🦀
View GitHub Profile
@jamesrampton
jamesrampton / border.sh
Created April 29, 2022 15:20
GraphicsMagick add 10% border based on shortest edge
#!/usr/bin/env bash
BORDER=$((`gm identify -format "%w\n%h" image.jpg | sort -n | head -1`*10/100))
gm convert -border $BORDERx$BORDER -bordercolor #111111 image.jpg image-with-border.jpg
@jamesrampton
jamesrampton / grepr.sh
Created January 10, 2013 16:30
Grep for file contents recursively
#!/bin/bash
grep -R -i -n 'foo()' *
@jamesrampton
jamesrampton / show_all_files.sh
Created January 10, 2013 16:29
Show all files in Finder
#!/bin/bash
defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder
@jamesrampton
jamesrampton / get_site.sh
Created January 10, 2013 16:25
Grab a website
#!/bin/bash
wget --wait=1 -r -x -m -e robots=off --exclude-directories=/path1,/path2 http://example.com
@jamesrampton
jamesrampton / open_without.sh
Last active October 8, 2019 21:16
Clean up Mac OS X Open With menu
#!/bin/bash
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
killall Finder