Skip to content

Instantly share code, notes, and snippets.

View youens's full-sized avatar

Justin Youens youens

View GitHub Profile
Verifying that +youens is my blockchain ID. https://onename.com/youens
@youens
youens / gist:8caba0f1edfcb40ff2ed
Created May 6, 2014 15:43
Flexible Boolean String Parser
+ (BOOL)parseBooleanValueFromString:(NSString *)value defaultValue:(BOOL)defaultValue {
if (!value) return defaultValue;
if ([@[@"1", @"yes", @"on", @"true"] containsObject:[value lowercaseString]]) {
return YES;
}
else if ([@[@"0", @"no", @"off", @"false"] containsObject:[value lowercaseString]]) {
return NO;
}
@youens
youens / gist:3131550
Created July 17, 2012 19:45
Handle iOS URL Schemes
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
NSLog(@"url recieved: %@", url);
NSLog(@"scheme: %@", [url scheme]);
NSLog(@"query string: %@", [url query]);
NSLog(@"host: %@", [url host]);