Skip to content

Instantly share code, notes, and snippets.

View Grayson's full-sized avatar

Grayson Hansard Grayson

View GitHub Profile
@Grayson
Grayson / updateWebkit.sh
Created October 8, 2008 01:34
A WebKit.app updater script.
#!/usr/bin/env bash
# Echo some information to STDOUT as well as show a growl notification if available
function notify {
if [[ -f /usr/local/bin/growlnotify ]]; then
echo $1 | /usr/local/bin/growlnotify "Updating WebKit"
fi
echo $1
}
@Grayson
Grayson / getDefaultAppForURL.py
Created October 4, 2008 19:56
Get default application for url schemes.
#!/usr/bin/env python
# usage: python getDefaultAppForURL.py 'http://' 'ftp://' 'afp://'...
from LaunchServices import LSGetApplicationForURL, kLSRolesViewer
from Foundation import NSURL
from sys import argv
for arg in argv[1:]:
url = NSURL.URLWithString_(arg)
if url == None: continue