This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'osx/cocoa' | |
require 'date' | |
OSX.require_framework "AddressBook" | |
filePath = "%%%{PBXFilePath}%%%" | |
fileName = File.basename(filePath) | |
projName = File.basename(File.dirname(filePath)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIWebView (WebViewManualRedrawSupport) | |
- (id) _documentView; | |
@end | |
@interface NSObject (WebViewManualRedrawSupport) | |
- (id) _webCoreNeedsDisplay; | |
@end | |
@implementation MyTableCellContainingAWebView (GetRidOfUglyGreyBlock) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# This script parses a crashdump file and attempts to resolve addresses into function names. | |
# | |
# It finds symbol-rich binaries by: | |
# a) searching in Spotlight to find .dSYM files by UUID, then finding the executable from there. | |
# That finds the symbols for binaries that a developer has built with "DWARF with dSYM File". | |
# b) searching in various SDK directories. | |
# | |
# Copyright (c) 2008 Apple Inc. All Rights Reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Memory.c | |
* Outpost | |
* | |
* Created by Jim Dovey on 23/04/09. | |
* Copyright 2009 Morfunk, LLC. All rights reserved. | |
* | |
* Copyright (c) 2009, Jim Dovey | |
* All rights reserved. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <libkern/OSAtomic.h> | |
@implementation SomeClass | |
+ (id) someStaticValueComputedOnFirstAccess | |
{ | |
static volatile id __staticVar = nil; | |
if ( __staticVar == nil ) | |
{ | |
id var = [[Something alloc] init]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before: | |
- (IBAction) optimizeDataObject: (MyDataObject *) obj | |
{ | |
// going to start work, so show the user that something's happening | |
[self.progressIndicator startAnimating]; | |
// these two are *usually* quick -- unless the user opens a 1GB file. | |
// because this is happening in an event handler, it'll stall the event loop, which | |
// causes the good ol' spinning beachball of death | |
[self pruneDuplicatesInDataObject: obj]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) functionWhichAnnoyinglyBlocksExecution: (NSFileHandle *) annoyingFileHandle | |
{ | |
dispatch_async(dispatch_get_global_queue(0,0), ^{ | |
id result = [annoyingFileHandle someBlockingOp]; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[myController displayResult: result]; | |
}); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* $TM_FILENAME | |
* ${1:`echo "$TM_FILEPATH" | awk -F"/" '{x=NF-1}{print $x}'`} | |
* | |
* Created by `id -P | awk -F ":" '{ print $8 }'` on `date "+%d/%m/%Y"`. | |
* | |
* Copyright (c) `date +%Y` ${2:$TM_ORGANIZATION_NAME} | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* proplist.go | |
* PropertyLists | |
* | |
* Created by Jim Dovey on 17/11/2009. | |
* | |
* Copyright (c) 2009 Jim Dovey | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* smart_status.c | |
* SMARTStatus | |
* | |
* Created by Jim Dovey on 6/12/2009. | |
* | |
* Copyright (c) 2009 Jim Dovey | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without |
OlderNewer