Skip to content

Instantly share code, notes, and snippets.

@useless
useless / gist:337509
Created March 19, 2010 13:48
Compare application bundle sizes to size of binaries in Mac OS X.
# Compare application bundle sizes to size of binaries in Mac OS X.
du -sk /Applications/
du -sk /Applications/*.app/Contents/MacOS | awk '{total=total+$1} END {print total}'
# Size of designable.nib files. Requires up-to-date locatedb.
locate /Applications/*designable.nib | xargs -I P du -sk 'P' | awk '{total=total+$1} END {print total}'
@useless
useless / gist:275195
Created January 12, 2010 13:31
Create a combined image. Requires PHP with GD support.
#!/usr/bin/php
<?php
$Images = array();
$img = '';
$r = 0.5;
$H = 300;
$W = 0;
for($i=1; $i<$argc; $i++)
@useless
useless / gist:208718
Created October 12, 2009 20:45
Open “unsaveable” images in a new window.
javascript:if(frames[1]){var%20d=frames[1].document;}else{var%20d=document;}var%20is=d.getElementsByTagName("img");window.open(is[is.length-1].getAttribute("src"));
@useless
useless / gist:201657
Created October 4, 2009 21:55
Setting Icon.icns as the icon for File.ext.
echo "read 'icns' (-16455) \"Icon.icns\";" > Icon.r
Rez -append -o File.ext Icon.r
SetFile -a CE File.ext