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 © 2013 Advantis | |
// | |
#import <SystemConfiguration/SystemConfiguration.h> | |
typedef void (^ADVReachabilityHandler)(SCNetworkReachabilityFlags flags); | |
@interface ADVReachability : NSObject |
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
/* All measurements were done on iPhone 4 */ | |
// MRC: | |
// descriptor sorting time: 18.503416ms | |
// comparator sorting time: 4.665041ms | |
// concurrent comparator sorting time: 4.703520ms | |
// ARC (w/o __unsafe_unretained): | |
// descriptor sorting time: 19.011437ms | |
// comparator sorting time: 14.852541ms |
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 © 2012 Yuri Kotov | |
// | |
#import <Foundation/Foundation.h> | |
@interface ADVSafeProxy : NSProxy | |
- (id) initWithObject:(id)object; |
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
+[NSObject load] | |
__attribute__((constructor)) | |
main() | |
+[NSObject initialize] | |
... | |
atexit() | |
__attribute__((destructor)) |
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 © 2012 Yuri Kotov | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSObject (ADVCasting) | |
+ (instancetype) staticCast:(id)from; | |
+ (instancetype) dynamicCast:(id)from; |
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
var fileName = prompt('Image name', 'image'); | |
if (null != fileName) | |
{ | |
var selection = activeDocument.selection; | |
try | |
{ | |
selection.copy(true); | |
} | |
catch (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
// | |
// Copyright © 2013 Yuri Kotov | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSUserDefaults (ADVKeyedSubscript) | |
- (id) objectForKeyedSubscript:(NSString *)key; | |
- (void) setObject:(id)object forKeyedSubscript:(NSString *)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
#!/usr/bin/python | |
import lldb | |
import shlex | |
def mem_location(arch, index): | |
index = int(index) | |
return { | |
'arm' : ("$r%d" % (index)) if (index < 4) else ("$sp+%d" % (index - 4)), | |
'armv7' : ("$r%d" % (index)) if (index < 4) else ("$sp+%d" % (index - 4)), |
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 © 2012 Yuri Kotov | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIViewController (ADVOverlay) | |
@property (nonatomic, readonly) UIViewController *overlayViewController; |
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
// Thought #1 | |
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" | |
[self performSelector:NSSelectorFromString(segue.identifier) | |
withObject:segue.destinationViewController]; | |
#pragma clang diagnostic pop | |
} |