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
/* | |
* System Versioning Preprocessor Macros | |
*/ | |
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
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
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
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
// | |
// Created by Cédric Luthi on 2012-02-24. | |
// Copyright (c) 2012 Cédric Luthi. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSData (Base64) | |
+ (id) dataWithBase64Encoding_xcd:(NSString *)base64String; |
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 <objc/runtime.h> | |
@implementation NSObject (ARCZombie) | |
+ (void) load | |
{ | |
const char *NSZombieEnabled = getenv("NSZombieEnabled"); | |
if (NSZombieEnabled && tolower(NSZombieEnabled[0]) == 'y') | |
{ | |
Method dealloc = class_getInstanceMethod(self, @selector(dealloc)); |
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
+ (void)drawNoiseWithOpacity:(CGFloat)opacity inRect:(CGRect)rect{ | |
static UIImage *noiseImage = nil; | |
static dispatch_once_t oncePredicate; | |
dispatch_once(&oncePredicate, ^{ | |
NSUInteger width = 64, height = 64; | |
NSUInteger size = width*height; | |
char *rgba = (char *)malloc(size); srand(124); | |
for(NSUInteger i=0; i < size; ++i){rgba[i] = rand()%256;} | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); | |
CGContextRef bitmapContext = |
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
// | |
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#if TARGET_OS_SIMULATOR | |
static const char *fakeCarrier; | |
static const char *fakeTime; |
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
#if ! __has_feature(objc_arc) | |
#error This file/class is targeted for the ARC compiler. Either turn on ARC for your project or use -fobjc-arc flag | |
#endif |
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
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) ) |
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
UI- and App Frameworks Evangelist - Jake Behrens, [email protected], twitter: @Behrens | |
- What's new in Cocoa | |
- Accessibility in iOS | |
- Building User Interfaces for iOS 7 | |
- Getting Started with UIKit Dynamics | |
- What's new in Cocoa Touch | |
- What's New With Multitasking | |
- Best Practices for Cocoa Animation | |
- Improving Power Efficiency with App Nap | |
- Introducing Text Kit |
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
#define MSDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead."))) | |
// Sample usage: | |
- (instancetype)initWithObject:(id)object; | |
- (instancetype)init MSDesignatedInitializer(initWithObject:); // <- This even gets auto-complete. | |
// Now calling init on this class would throw a warning. |
OlderNewer