Skip to content

Instantly share code, notes, and snippets.

@wanderwaltz
wanderwaltz / Preferences.sublime-settings
Created June 15, 2014 12:40
Sublime Text 2 settings file.
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
"font_size": 20.0,
"ignored_packages": [
"Vintage"
],
"open_files_in_new_window": false,
"rulers": [
100
],
@wanderwaltz
wanderwaltz / Script.txt
Created April 4, 2013 06:30
Count Number of Lines in Xcode project
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" ")" -print| xargs wc -l
@wanderwaltz
wanderwaltz / PrintWebView.m
Created March 30, 2013 06:45
Print contents of an UIWebView
UIPrintInteractionController *controller =
[UIPrintInteractionController sharedPrintController];
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
controller.printInfo = printInfo;
controller.printFormatter = [_webView viewPrintFormatter];
controller.showsPageRange = YES;
@wanderwaltz
wanderwaltz / getIPAddress.m
Created March 30, 2013 06:44
Get the IP address of an iOS device.
- (NSString *) getIPAddress
{
NSString *address = nil;
structifaddrs *interfaces = NULL;
structifaddrs *temp_addr = NULL;
int success = 0;
@wanderwaltz
wanderwaltz / NonRetainingContainers.m
Created March 30, 2013 06:42
Non-retaining Cocoa containers from Three20.
static const void *TTRetainNoOp(CFAllocatorRef allocator,
const void *value) {return value;}
static void TTReleaseNoOp(CFAllocatorRef allocator,
const void *value) {}
NSMutableArray *TTCreateNonRetainingArray()
@wanderwaltz
wanderwaltz / Script.txt
Last active December 15, 2015 14:39
Xcode shell script build step: show TODO's and FIXME's as warnings. http://deallocatedobjects.com/posts/show-todos-and-fixmes-as-warnings-in-xcode-4
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"