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 ViewFactory : NSObject { | |
NSMutableDictionary * viewTemplateStore; | |
} | |
- (id) initWithNib:(NSString*)aNibName; | |
- (UITableViewCell*)cellOfKind:(NSString*)theCellKind forTable:(UITableView*)aTableView; | |
@end |
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 "ViewFactory.h" | |
@implementation ViewFactory | |
- (id) initWithNib:(NSString*)aNibName | |
{ | |
if (self == [super init]) { | |
viewTemplateStore = [[NSMutableDictionary alloc] init]; | |
NSArray * templates = [[NSBundle mainBundle] loadNibNamed:aNibName owner:self options:nil]; | |
for (id template in templates) { |
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
hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso |
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
\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))) |
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
function parse_branch { | |
local BRANCH=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/') | |
if [ -z "$BRANCH" ] | |
then | |
BRANCH=$(hg branch 2>/dev/null) | |
if [ -n "$BRANCH" ] | |
then | |
BRANCH="("$BRANCH")" | |
fi | |
fi |
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
cd "$DATABASE_LOCATION" | |
echo '.dump'|sqlite3 $DB_NAME|sqlite3 repaired_$DB_NAME | |
mv $DB_NAME corrupt_$DB_NAME | |
mv repaired_$DB_NAME $DB_NAME |
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
find Classes -name '*.[hmM]' -print0|xargs -0 wc -l |
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
Find: ^([+-] \(.* \*\))( ) | |
Replace: \1 |
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
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
[self callAsyncBlock:^() { | |
// Do some work | |
dispatch_semaphore_signal(semaphore); | |
}]; | |
// Wait until the semaphore has been signaled | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
dispatch_release(semaphore); |
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
> find /Applications/Xcode.app -name clang | |
# Pick one | |
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c /dev/null -dM -E |
OlderNewer