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 Scripts/ | |
Scripts $ mkdir Python | |
Scripts $ git clone https://github.com/xolox/vim-tools.git | |
Cloning into 'vim-tools'... | |
remote: Reusing existing pack: 373, done. | |
remote: Total 373 (delta 0), reused 0 (delta 0) | |
Receiving objects: 100% (373/373), 120.88 KiB | 34 KiB/s, done. | |
Resolving deltas: 100% (213/213), done. |
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
- (NSString *)camelCaseToTitleCase { | |
NSMutableString *string = [NSMutableString string]; | |
NSCharacterSet *upper = [NSCharacterSet uppercaseLetterCharacterSet]; | |
for (NSInteger index = 0; index < [self length]; index++) { | |
NSString *character = [self substringWithRange:NSMakeRange(index, 1)]; | |
if ([character rangeOfCharacterFromSet:upper].location != NSNotFound) { | |
[string appendString:@" "]; | |
} | |
[string appendString:character]; |
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
- (NSString *)titleCaseToCamelCase { | |
NSString *string = [self capitalizedString]; | |
string = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; | |
string = [NSString stringWithFormat:@"%@", string]; | |
return [string stringByReplacingCharactersInRange:NSMakeRange(0, 1) | |
withString:[[string substringToIndex:1] | |
lowercaseString]]; | |
} |
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
.h | |
extern NSString *const MyFirstConstant; | |
.m | |
NSString *const MyFirstConstant = @"FirstConstant"; |
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
+ (NSString *)entityName { | |
return NSStringFromClass(self); | |
} | |
+ (AbstractEntity *)insertNewObjectInManagedObjectContext:(NSManagedObjectContext *)moc { | |
return [NSEntityDescription insertNewObjectForEntityForName:[self entityName] | |
inManagedObjectContext:moc]; | |
} |
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
:%s/¶/" ,\r "/g | |
" Replace every occurrence of the paragraph character with a quote, comma, carriage return, four spaces and a quote. |
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/libexec/PlistBuddy /Applications/SpamSieve.app/Contents/Info.plist -c "Set LSUIElement 1" | |
codesign -f -s - /Applications/SpamSieve.app |
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
#!/bin/bash | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" |
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
# command for using mogenerator to generate core data classes. | |
# should be executed from the same directory as the data model is found | |
mogenerator --model DataModel.xcdatamodeld --output-dir mogenerated --template-var arc=true --includeh XXXDataModel.h |
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
#ifdef DEBUG | |
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] | |
#define OLog(arg) NSLog(@"%s %@", __PRETTY_FUNCTION__, arg) | |
#else | |
#define DLog(...) do { } while (0) | |
#define OLog(arg) do { } while (0) | |
#ifndef NS_BLOCK_ASSERTIONS |
OlderNewer