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
| git rebase -i [COMMIT BEFORE THE FIRST YOU WANT TO EDIT] | |
| # Mark all messages to be changed with "edit". | |
| # Git will start the rebasing and stop at every marked commit. | |
| git commit -amend -m "new message" | |
| git rebase -continue |
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
| class Array2D<T> { | |
| let columns: Int | |
| let rows: Int | |
| var array: Array<T?> | |
| init(columns: Int, rows: Int) { | |
| self.columns = columns | |
| self.rows = rows | |
| array = Array<T?>(count: rows * columns, repeatedValue: 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
| git checkout release | |
| git pull --rebase origin release | |
| git branch {branch} | |
| git checkout {branch} | |
| git cherry-pick 1283094rtwedfsgg | |
| git push origin {branch} |
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
| @implementation UIViewController (Swizzled) | |
| + (void)load | |
| { | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| [self swizzlingInstanceMethod:@selector(viewDidLoad) swizzledSelector:@selector(swizzled_viewDidLoad)]; | |
| }); | |
| } |
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
| @implementation ViewController | |
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| UIView *view = [[UIView alloc] init]; | |
| view.backgroundColor = [UIColor whiteColor]; | |
| [self.view addSubview:view]; |
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
| find . -name ".DS_Store" -print0 | xargs -0 rm -rf |
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
| #import <sys/utsname.h> | |
| @implementation ViewController | |
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| // Do any additional setup after loading the view, typically from a nib. | |
| NSLog(@"%@", [self machineName]); | |
| } |
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)dismiss | |
| { | |
| [CATransaction begin]; | |
| CATransition *transition = [CATransition animation]; | |
| transition.type = kCATransitionReveal; | |
| transition.subtype = kCATransitionFromTop; | |
| transition.duration = 0.25f; | |
| transition.fillMode = kCAFillModeForwards; | |
| transition.removedOnCompletion = YES; |
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
| CFStringRef eventStr = CFSTR("Hello, I'm an event."); | |
| CFIndex length = CFStringGetLength(eventStr); | |
| CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); | |
| char *event = (char *)malloc(maxSize); | |
| CFStringGetCString(eventStr, event, maxSize,kCFStringEncodingUTF8); | |
| printf("Event %s\n", event); |
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
| #import <Foundation/Foundation.h> | |
| #include <CoreServices/CoreServices.h> | |
| void callbackFunction( ConstFSEventStreamRef streamRef, | |
| void *clientCallBackInfo, | |
| size_t numEvents, | |
| void *eventPaths, | |
| const FSEventStreamEventFlags eventFlags[], | |
| const FSEventStreamEventId eventIds[] ) |