This file contains hidden or 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
| NSString *tempDirectoryTemplate = | |
| [NSTemporaryDirectory() stringByAppendingPathComponent:@"myapptempdirectory.XXXXXX"]; | |
| const char *tempDirectoryTemplateCString = | |
| [tempDirectoryTemplate fileSystemRepresentation]; | |
| char *tempDirectoryNameCString = | |
| (char *)malloc(strlen(tempDirectoryTemplateCString) + 1); | |
| strcpy(tempDirectoryNameCString, tempDirectoryTemplateCString); | |
| char *result = mkdtemp(tempDirectoryNameCString); | |
| if (!result) |
This file contains hidden or 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
| static NSMutableDictionary* resources_ = nil; | |
| @implementation GRResource | |
| + (void)initialize | |
| { | |
| static dispatch_once_t once; | |
| dispatch_once(&once, ^{ | |
| resources_ = [NSMutableDictionary new]; | |
| }); |
This file contains hidden or 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)addTask:(GRTask*)task | |
| importer:(Class<GRImporter>)Importer | |
| resources:(NSArray*)requiredResources | |
| completionBlock:(GRImportCompletionBlock)complete | |
| { | |
| NSDictionary* taskInfo = [task dictionaryRepresentation]; | |
| GRImportCompletionBlock done = [complete copy]; | |
| [self addOperationWithBlock:^{ | |
| // ask plugin to generate an import block for this task |
This file contains hidden or 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
| PS1="\w \$(~/bin/battery.sh) " |
NewerOlder