Skip to content

Instantly share code, notes, and snippets.

View carlosmcevilly's full-sized avatar

Carlos McEvilly carlosmcevilly

View GitHub Profile
@carlosmcevilly
carlosmcevilly / gist:1247248
Created September 28, 2011 07:36
expand a package (.pkg) file in osx from the command line
pkgutil --expand /path/to/package.pkg /output/destination/
@carlosmcevilly
carlosmcevilly / hex2uicolor.pl
Created September 28, 2011 20:39
hex2uicolor command line script - given a hex value color, print several useful representations of the color
#!/usr/bin/perl
# hex2uicolor
# Copyright 2009 by Carlos McEvilly - Apache License
use strict;
use warnings;
my ($r,$g,$b) = @ARGV;
@carlosmcevilly
carlosmcevilly / file-to-data.sh
Created October 16, 2011 05:54
script create an img tag with data for a given .png image file
#!/bin/bash
# create an <img src=""> tag with data for a given .png image file
export in=$1
if [[ "$in" == '' ]]; then
echo "usage: $0 infile"
exit -1
fi
@carlosmcevilly
carlosmcevilly / do-rename.sh
Created October 16, 2011 07:03
project rename helper for Xcode 3.x projects.
#!/bin/bash
# project rename helper for Xcode 3.x projects. Not yet updated for Xcode 4.x (in particular, workspaces)
# makes some assumptions about file locations which may differ from your project layout.
# important: also assumes it's OK to rename *every* instance of <oldname> to <newname> in
# your project, even in places where they might not be acting as names.
echo "this is outdated, so this is provided for reference only. use at your own risk"
exit # refuse to run. anyone who runs this should read and understand the whole thing before removing this line.
@carlosmcevilly
carlosmcevilly / doc-methods
Created October 25, 2011 16:27
destructively filter the paste buffer to find objective-c methods
#!/bin/bash
# doc-methods
# no arguments
#
# usage: load the docs for an obj-c protocol, select all, copy, then run this.
#
# on osx, takes the contents of the paste buffer and replaces it with
# only the lines from the paste buffer that look like obj-c methods,
# based on a really simple heuristic
@carlosmcevilly
carlosmcevilly / make-docs-link
Created October 31, 2011 22:45
Create a symbolic link on your desktop pointing to the iPhone Simulator Documents folder for a given app
git submodule foreach git submodule init && git submodule update --recursive
@carlosmcevilly
carlosmcevilly / make-defaults.sh
Created November 18, 2011 20:02
Make labeled default placeholder images for iPad in various orientations
#!/bin/bash
# <basename><orientation_modifier><scale_modifier><device_modifier>.png
export bgcolor=blue
export txtcolor=#FFFFFF
export fontsm=24
export fontlg=48
# PortraitUpsideDown
@carlosmcevilly
carlosmcevilly / gist:1457794
Created December 11, 2011 02:27
xcodebuild short example
xcodebuild -project Foo.xcodeproj -target Foo -configuration Debug -sdk iphonesimulator5.0 clean build
@carlosmcevilly
carlosmcevilly / gist:1473566
Created December 13, 2011 19:42
Get underlying data from a CGImage
CGDataRef imageDataRef = CGDataProviderCopyData(CGImageGetDataProvider(myCGImageRef)));