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
| _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge] ; | |
| _activityIndicatorView.center = [[self tableView] center]; | |
| _activityIndicatorView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.75]; | |
| CGRect screenRect = [[UIScreen mainScreen] bounds]; | |
| CGFloat screenWidth = screenRect.size.width; | |
| CGFloat screenHeight = screenRect.size.height; | |
| // Time for some geometry. The 150 is the frame width and 150 is the height. | |
| // These are static in code for now. Potential to make another view to reuse. |
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
| /* | |
| Generate a request with params. | |
| POST /post/url | |
| Host: www.example.com | |
| Content-Type: application/x-www-form-urlencoded; charset=utf-8 | |
| uuid=12345-ABC-9876-XYZ&first_name=john&last_name=doe | |
| */ |
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
| NSError *error; | |
| NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionaryOrArrayToOutput options:NSJSONWritingPrettyPrinted error:&error]; | |
| if (!jsonData) { | |
| NSLog(@"Got an error: %@", error); | |
| } else { | |
| NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | |
| } |
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
| // Initializing Variables | |
| var userChoice = prompt("Do you choose rock, paper, scissors, lizard, or spock?"); | |
| var choices = ["rock", "paper", "scissors", "lizard", "spock"]; | |
| var computerChoice = choices[ Math.floor( Math.random() * choices.length ) ]; | |
| // Function that compares the two values | |
| function compare( choice1, choice2 ) { | |
| var rock = { | |
| defeats: ["scissors", "lizard"], |
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
| # Xcode | |
| .DS_Store | |
| */build/* | |
| *.pbxuser | |
| !default.pbxuser | |
| *.mode1v3 | |
| !default.mode1v3 | |
| *.mode2v3 | |
| !default.mode2v3 | |
| *.perspectivev3 |
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> | |
| @interface EmailRepository : NSObject | |
| + (id)sharedEmailRepository; | |
| - (void)getDataFromServer:(NSString *)emailAddress onComplete:(void (^)(NSString *response))completionBlock onFailure:(void (^)(NSString *response))failureBlock; | |
| @end |
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 void Main() | |
| { | |
| Console.WriteLine(@" | |
| LET OFF SOME STEAM, BENNETT. | |
| '''';;;;;;;;;;;';;;''';::,,,:::::::;''++++++++++++ | |
| ;;;::::;;;;;;;;'++#'';;::,,,:::;;::;''++++++++++++ | |
| ;;::::::::;;;;##++#@#';;:,,:::;;;;;;''++++++++++++ | |
| ;;::::::::;;;#+,,,,;;+;;:::::;;'';;;'''+++++++++++ |
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
| /* | |
| * Compare the installed to required version. | |
| * | |
| * @param {String} installed The currently installed version string. | |
| * @param {String} required The required version string. | |
| * | |
| * compareVersions('1.0.1', '1.0.0') returns true | |
| * compareVersions('1.0.0', '1.0.0') returns true | |
| * compareVersions('0.0.9', '1.0.0') returns false | |
| * compareVersions('1.0.0', '1.0.1') returns false |
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 *URLString = @"http://example.com/path"; | |
| NSDictionary *parameters = @{ }; | |
| NSURLRequest *request = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil]; | |
| AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; |
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 ExampleClass : UIViewController | |
| @property (nonatomic, assign) BOOL someBool; | |
| // a few method declarations | |
| @end |