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
--[[ | |
%% properties | |
378 sceneActivation | |
%% weather | |
%% events | |
%% globals | |
--]] | |
function anyBlindIsClosed(blindIDs) | |
for index, blindID in ipairs(blindIDs) do |
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
@interface TXLocation : MTLModel <MTLJSONSerializing> | |
@property (strong, nonatomic, readonly) NSString *status; | |
@property (strong, nonatomic, readonly) NSNumber *sector; | |
@property (strong, nonatomic, readonly) NSString *macAddress; | |
@property (strong, nonatomic, readonly) NSNumber *facilityId; | |
@property (strong, nonatomic, readonly) NSNumber *departmentId; | |
@property (strong, nonatomic, readonly) NSNumber *mapId; | |
@property (strong, nonatomic, readonly) NSNumber *mapVersion; |
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
+ (UIImage *)imageResource:(NSString *)name ofType:(NSString *)type { | |
NSString *systemVersion = UIDevice.currentDevice.systemVersion; | |
NSString *iOSMajorSystemVersion = (systemVersion.length) ? [NSString stringWithFormat:@"iOS%@", [systemVersion substringToIndex:1]] : @"iOS"; | |
if (UIScreen.mainScreen.bounds.size.height == 568.0f) { | |
/* iPhone 5 */ | |
NSString *iPhone5SystemVersionImageName = [NSString stringWithFormat:@"%@-%@-568h@2x", name, iOSMajorSystemVersion]; | |
NSString *iPhone5SystemVersionImagePath = [NSBundle.mainBundle pathForResource:iPhone5SystemVersionImageName ofType:type]; | |
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
@interface NSString (Comparisons) | |
- (BOOL)containsString:(NSString *)substring; | |
- (BOOL)isSubstringOfString:(NSString *)string; | |
- (BOOL)isEqualToAnyOfStrings:(NSArray *)strings; | |
- (BOOL)isEqualToNoneOfStrings:(NSArray *)strings; | |
@end |
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 <Foundation/Foundation.h> | |
@interface NSString (GroupedDelimitedString) | |
- (NSString *)stringByGroupingBySize:(NSInteger)groupSize withDelimiter:(NSString *)delimiter; | |
@end |
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
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.2 (140) | |
# | |
# Alignment | |
# --------- | |
## Alignment |
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 *)stringByEscapingJSONReservedCharacters { | |
return [[[[[[[[self stringByReplacingOccurrencesOfString:@"\\\\" withString:@"☃"] /* \\ (single slash character) for snowman */ | |
stringByReplacingOccurrencesOfString:@"\\n" withString:@"\\\\n"] /* \n for \\n */ | |
stringByReplacingOccurrencesOfString:@"\\t" withString:@"\\\\t"] /* \t for \\t */ | |
stringByReplacingOccurrencesOfString:@"\\b" withString:@"\\\\b"] /* \b for \\b */ | |
stringByReplacingOccurrencesOfString:@"\\f" withString:@"\\\\f"] /* \f for \\f */ | |
stringByReplacingOccurrencesOfString:@"\\r" withString:@"\\\\r"] /* \r for \\r */ | |
stringByReplacingOccurrencesOfString:@"\\\"" withString:@"\\\\\""] /* \" for \\" */ | |
stringByReplacingOccurrencesOfString:@"☃" withString:@"\\\\\\\\"]; /* snowman for \\\\ (single slash character) */ | |
} |
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
+ (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)size { | |
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { | |
UIGraphicsBeginImageContextWithOptions(size, NO, [[UIScreen mainScreen] scale]); | |
} else { | |
UIGraphicsBeginImageContext(size); | |
} | |
[image drawInRect:CGRectMake(0, 0, size.width, size.height)]; | |
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return newImage; |