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
Simons-MacBook-Air:ruby simon$ git clone https://github.com/siuying/motion-github-followers | |
Testing Environment | |
==================== | |
* OS X 10.8 | |
* Xcode 4.4 | |
* 1.6Ghz Core i5 (MBA 11", Mid 2011) | |
* 4GB memory |
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
#pragma mark DLCImagePickerControllerDelegate | |
-(void) imagePickerControllerDidCancel:(DLCImagePickerController *)picker{ | |
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO]; | |
[self dismissModalViewControllerAnimated:YES]; | |
} | |
- (void)uploadMediaInfo:(NSDictionary *)info { | |
UIImage *resizedImage = [[info objectForKey:@"image"] imageCroppedToFitSize:CGSizeMake(800, 800)]; | |
NSData *jpegData = UIImageJPEGRepresentation(resizedImage, 0.5); |
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
- (void)enableNetworkDebug { | |
[[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidStartNotification | |
object:nil | |
queue:nil | |
usingBlock:^(NSNotification *note) { | |
AFHTTPRequestOperation *op = [note object]; | |
NSLog(@"\n\nREQUEST:%x \n%@\n\n", (NSUInteger)op.request, [TTTURLRequestFormatter cURLCommandFromURLRequest:op.request]); | |
}]; | |
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
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"NavBar"] forBarMetrics:UIBarMetricsDefault]; |
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 *url = [NSString stringWithFormat:@"http://XXXX.s3-ap-southeast-1.amazonaws.com/%@", path]; | |
[cell.imageView setImageWithURL:[NSURL URLWithString:url] placeholderImage:nil]; |
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
- (NSDate *)parseDate:(NSString *)object { | |
if ([object isKindOfClass:[NSString class]]) { | |
// See workaround for parsing RFC3339 dates: | |
// http://stackoverflow.com/questions/4330137/parsing-rfc3339-dates-with-nsdateformatter-in-ios-4-x-and-macos-x-10-6-impossib | |
NSError *error = nil; | |
NSDate *date = nil; | |
[[self dateFormatter] getObjectValue:&date forString:object range:nil error:&error]; | |
return date; | |
} |
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
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://2175854` |
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
-- TLC - The Tiny Lua Cocoa bridge | |
-- Note: Only tested on x86_64 with OS X >=10.7.3 & iPhone 4 with iOS 5 | |
-- Copyright (c) 2012, Fjölnir Ásgeirsson | |
-- Permission to use, copy, modify, and/or distribute this software for any | |
-- purpose with or without fee is hereby granted, provided that the above | |
-- copyright notice and this permission notice appear in all copies. | |
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
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
- (id)init | |
{ | |
if (self = [super initNibName:nil bundle:nil]) { | |
[[self whenViewDidLoad] then:^{ | |
id loginPromise = [client login:self.loginField password:self.passwordField when:[self.loginButton whenTouchDown]]; | |
[UIAlertView presentMessage:^{ return [loginPromise alertError]; } when:[loginPromise whenFail]]; | |
[client saveAccessToken:[self.loginPromise whenSuccess]]; | |
[self presentModalViewController:[RegisterViewController willCreate] when:[self.registerButton whenTouchDown]]; | |
}]; |
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
- (id)init | |
{ | |
if (self = [super initNibName:nil bundle:nil]) { | |
[[self whenViewDidLoad] then:^(id result, NSError *error) { | |
[[self.loginButton whenTouchDown] then:^(id result, NSError *error) { | |
[[client login:self.loginField.text password:self.passwordField.text] then:^(id result, NSError *error) { | |
[client saveAccessToken:[result token]]; |
OlderNewer