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
#import "CTTelephonyNetworkInfo+ConnectionClassifier.h" | |
@implementation CTTelephonyNetworkInfo (ConnectionClassifier) | |
// Naive implementation. | |
- (BOOL)isFast:(NSString*)radioAccessTechnology { | |
if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) { | |
return NO; | |
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge]) { |
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
#!/bin/sh | |
# Shell file to run X3D-Edit 3.2 | |
# First make sure we're running 1.6, will bomb if not | |
source `dirname $0`/javaVersionCheck.sh | |
# Memory settings for X3D-Edit 3.2: see ReadmeX3D-EditMemorySettings.txt | |
# The default settings for a zipped app exist in x3deditor32/etc/x3deditor32.conf | |
# The stack (-Xss2m) setting is under evaluation and may need | |
# increasing because of recursive routines in XML and XSLT processing. |
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
NSDictionary *rabbits = @{@"name": @"Bugs", @"color":@"#777"}; | |
NSError *error; | |
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:rabbits | |
options:NSJSONWritingPrettyPrinted | |
error:&error]; | |
NSLog(@"Pretty Printed JSON:%@", [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]); |
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
// Returns true if array contains a String matching the specified regular expression pattern | |
extension SequenceType where Generator.Element == String { | |
func matches(pattern: String) -> Bool { | |
for item in self { | |
if (item.rangeOfString(pattern, options: .RegularExpressionSearch) != nil) { | |
return true | |
} | |
} | |
return false | |
} |
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
import Mapbox | |
// MGLPointAnnotation subclass | |
class MyCustomPointAnnotation: MGLPointAnnotation { | |
var willUseImage: Bool = false | |
} | |
class MyCustomPointAnnotationView: MGLAnnotationView { | |
static let reuseIdentifier = String(describing: MyCustomPointAnnotationView.self) |
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
import UIKit | |
class Animal: Codable { | |
var say: String? | |
private enum CodingKeys : String, CodingKey { | |
case say | |
} |