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
struct Table<valueType:Equatable>{ | |
var table:[[valueType]] = [[valueType]]() | |
var sectionCount:Int{ | |
get{ | |
return table.count | |
} | |
} | |
subscript(section:Int) -> [valueType]?{ |
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 | |
struct OrderedDictionary<KeyType:Hashable, ValueType:Hashable>{ | |
var keyArray = [KeyType]() | |
var keyToValue = [KeyType:ValueType]() | |
subscript(key:KeyType) -> ValueType? { | |
get{ | |
return keyToValue[key] | |
} |
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
struct BidirectionalDictionary<KeyType:Hashable, ValueType:Hashable>{ | |
var keyToValue = [KeyType:ValueType]() | |
var valueToKey = [ValueType:KeyType]() | |
subscript(key:KeyType) -> ValueType? { | |
get { | |
return self.keyToValue[key] | |
} | |
set { | |
self.keyToValue[key] = newValue |
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
self.layer.masksToBounds = NO; | |
self.layer.shadowOffset = CGSizeMake(2.5, 5); | |
self.layer.shadowRadius = 5; | |
self.layer.shadowOpacity = 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
#import "UIImage+UIViewCapture.h" | |
#import <QuartzCore/QuartzCore.h> | |
@implementation UIImage (UIViewCapture) | |
+ (UIImage *)imageWithView:(UIView *)view{ | |
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); | |
[view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); |
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
To encode | |
> base64 -i [source.binary] -o [destination.base64] | |
To decode | |
> base64 -D -i [source.base64] -o [destination.binary] | |
To encode directly into the clipboard | |
> base64 < [source.binary] | pbcopy |
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> | |
extern NSString *const ZZiptasticCityKey; | |
extern NSString *const ZZiptasticStateKey; | |
extern NSString *const ZZiptasticCountryKey; | |
extern NSString *const ZURLHTTPErrorCode; | |
typedef void (^ZZiptasticBlock)(NSDictionary *location, NSError *error); |
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 OrderedDictionary : NSObject <NSCopying, NSCoding>{ | |
NSMutableDictionary *_dictionary; | |
NSMutableArray *_array; | |
} | |
@property (readonly) NSUInteger count; | |
- (id)init; | |
- (id)initWithCapacity:(NSUInteger)capacity; | |
+ (id)dictionary; |
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
typedef void (^DrawBlock)(CGContextRef currentContext, CGRect drawRect, UIView *selfView); | |
@interface ZDrawView : UIView | |
@property (nonatomic, copy) DrawBlock drawBlock; | |
- (instancetype)initWithBlock:(DrawBlock)block; | |
+ (instancetype)viewWithBlock:(DrawBlock)block; |
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
.DS_Store | |
*.swp | |
*~.nib | |
build/ | |
*.pbxuser | |
*.perspective | |
*.perspectivev3 |
NewerOlder