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
// | |
// LOOProfiling.h | |
// | |
// Created by Marcin Swiderski on 4/12/12. | |
// Copyright (c) 2012 Marcin Swiderski. All rights reserved. | |
// | |
// This software is provided 'as-is', without any express or implied | |
// warranty. In no event will the authors be held liable for any damages | |
// arising from the use of this software. | |
// |
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
@implementation UIImage (ImageBlur) | |
// This method is taken from Apple's UIImageEffects category provided in WWDC 2013 sample code | |
- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage { | |
// Check pre-conditions. | |
if (self.size.width < 1 || self.size.height < 1) { | |
NSLog(@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); | |
return nil; | |
} | |
if (!self.CGImage) { | |
NSLog(@"*** error: image must be backed by a CGImage: %@", 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
//====================================== | |
for (NSString* family in [UIFont familyNames]) { | |
NSLog(@"%@", family); | |
for (NSString* name in [UIFont fontNamesForFamilyName: family]) { | |
NSLog(@" %@", name); | |
} | |
} | |
//====================================== |
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
@implementation UIView (CellSuperview) | |
- (UITableViewCell *)cellSuperview { | |
UIView *tableCell = self; | |
do { | |
tableCell = tableCell.superview; | |
} while (tableCell && ![tableCell isKindOfClass:[UITableViewCell class]]); | |
return (UITableViewCell *) tableCell; | |
} | |
@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
/** String: Identifier **/ | |
#define DEVICE_IDENTIFIER ( ( IS_IPAD ) ? DEVICE_IPAD : ( IS_IPHONE ) ? DEVICE_IPHONE , DEVICE_SIMULATOR ) | |
/** String: iPhone **/ | |
#define DEVICE_IPHONE @"iPhone" | |
/** String: iPad **/ | |
#define DEVICE_IPAD @"iPad" | |
/** String: Device Model **/ |
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
// This method requires ImageIO.framework | |
#import <ImageIO/ImageIO.h> | |
- (CGSize)sizeOfImageAtURL:(NSURL *)imageURL | |
{ | |
// With CGImageSource we avoid loading the whole image into memory | |
CGSize imageSize = CGSizeZero; | |
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)imageURL, NULL); | |
if (source) { | |
NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCGImageSourceShouldCache]; |
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
//================.h File====================== | |
typedef enum { | |
EnumType_1, | |
EnumType_2, | |
EnumTypeCount // enum count | |
} EnumType; | |
//enum to string |
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 "FileChangeObserver.h" | |
#undef Assert | |
#define Assert(COND) { if (!(COND)) { raise( SIGINT ) ; } } | |
@interface FileChangeObserver () | |
@property ( nonatomic, readonly ) int kqueue ; | |
@property ( nonatomic ) enum FileChangeNotificationType typeMask ; | |
@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
// | |
// FDRCollectionViewCell.h | |
// | |
// | |
// Created by Brent Royal-Gordon on 7/10/13. | |
// | |
// | |
#import <UIKit/UIKit.h> |
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
$ cd ~/Library | |
$ mkdir KeyBindings | |
$ cd KeyBindings | |
$ vi DefaultKeyBinding.dict |
OlderNewer