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) changeLanguage:(NSNotification *)notif { | |
| } | |
| - (void) registerNotifications { | |
| [[NSNotificationCenter defaultCenter] addObserver:self | |
| selector:@selector(changeLanguage:) | |
| name:kLanguageChangeNotification object:nil]; | |
| } |
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
| typedef enum { | |
| UIButtonTypeCustom = 0, // no button type | |
| UIButtonTypeRoundedRect, // rounded rect, flat white button, like in address card | |
| UIButtonTypeDetailDisclosure, | |
| UIButtonTypeInfoLight, | |
| UIButtonTypeInfoDark, | |
| UIButtonTypeContactAdd, | |
| } UIButtonType; |
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
| // retrieve a remote branch (and create it on local) | |
| git checkout -b readability origin/readability | |
| // push to remote a local branch (creates a new branch on the remote repo) | |
| git push origin customButtons // simple, right? |
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
| NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES]; | |
| NSArray *preSortedFinals = [finals sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]]; | |
| NSArray *sortedFinals = [NSArray arrayWithArray:preSortedFinals]; | |
| [descriptor release]; | |
| return sortedFinals; |
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
| NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
| [df setDateFormat:@"dd.MM.yyy HH:mm"]; | |
| NSString *date = [NSString stringWithFormat:@"%@ %@", schedule.date, schedule.time]; | |
| NSDate *realDate = [df dateFromString:date]; | |
| realDate = [realDate dateByAddingTimeInterval:60*60*2]; | |
| [df release]; | |
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
| UIImage *arrowRight = [UIImage imageNamed:@"arrow"]; | |
| // horizontal flip | |
| UIImage *arrowLeft = [UIImage imageWithCGImage:arrowRight.CGImage | |
| scale:2.0f orientation:UIImageOrientationUpMirrored]; | |
| // vertical flip | |
| UIImage *arrowLeft = [UIImage imageWithCGImage:arrowRight.CGImage | |
| scale:2.0f orientation:UIImageOrientationDownMirrored]; |
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)iterateFromOneTo:(int)limit withBlock:(int (^)(int))block; | |
| - (void) calculateLatestSpieltagWithCompletion:(void (^)(void))completion; | |
| // | |
| // Blocks as properties | |
| // | |
| typedef void(^MyCustomBlock)(void); |
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
| pretty_git_log() { | |
| git log --graph --pretty="tformat:${FORMAT}" $* | | |
| # Replace (2 years ago) with (2 years) | |
| sed -Ee 's/(^[^<]*) ago)/\1)/' | | |
| # Replace (2 years, 5 months) with (2 years) | |
| sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?)/\1)/' | | |
| # Line columns up based on } delimiter | |
| column -s '}' -t | | |
| # Page only if we need to | |
| less -FXRS |
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
| @interface NSArray (CustomFiltering) | |
| @end | |
| @implementation NSArray (CustomFiltering) | |
| - (NSArray *) filterObjectsByKey:(NSString *) key { | |
| NSMutableSet *tempValues = [[NSMutableSet alloc] init]; | |
| NSMutableArray *ret = [NSMutableArray array]; | |
| for(id obj in self) { | |
| if(! [tempValues containsObject:[obj valueForKey:key]]) { |
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
| ~/Library/Developer/Xcode/UserData/CodeSnippets/ |