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
Analysis of sampling Python (pid 75717) every 1 millisecond | |
Process: Python [75717] | |
Path: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python | |
Load Address: 0x10b733000 | |
Identifier: Python | |
Version: ??? (???) | |
Code Type: X86-64 (Native) | |
Parent Process: Python [75715] | |
Date/Time: 2015-04-15 09:08:02.400 +0200 |
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 NSObject (LogDealloc) | |
- (void)logOnDealloc; | |
@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 <UIKit/UIKit.h> | |
@interface UIView (Recursion) | |
/** | |
Return YES from the block to recurse into the subview. | |
Set stop to YES to return the subview. | |
*/ | |
- (UIView*)findViewRecursively:(BOOL(^)(UIView* subview, BOOL* stop))recurse; |
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
// | |
// NSArray+FirstObject.h | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSArray (FirstObject) | |
- (id)firstObject; |
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
static __inline__ CGRect CGRectFromCGSize( CGSize size ) { | |
return CGRectMake( 0, 0, size.width, size.height ); | |
}; | |
static __inline__ CGRect CGRectMakeWithCenterAndSize( CGPoint center, CGSize size ) { | |
return CGRectMake( center.x - size.width * 0.5, center.y - size.height * 0.5, size.width, size.height ); | |
}; | |
static __inline__ CGRect CGRectMakeWithOriginAndSize( CGPoint origin, CGSize size ) { | |
return CGRectMake( origin.x, origin.y, size.width, size.height ); |
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* image = [UIImage imageNamed:@"resources/images/my-image.png"]; |
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* image = GetImageWithID( kImageResourcesImagesMyImage ); |
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
static NSString* __AppResources[] = { | |
@"resources/images/my-image.png", | |
@"resources/images/my-image2.png", | |
@"resources/images/subfolder/my-image.png", | |
@"resources/test.pdf", | |
nil | |
}; | |
static const NSUInteger kImageResourcesImagesMyImage = 0; | |
static const NSUInteger kImageResourcesImagesMyImage2 = 1; |
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
header_subpath = "Resources.h" | |
resource_categories = { | |
".pdf" => "File", | |
".png" => "Image", | |
".jpg" => "Image" | |
} | |
def wikify(phrase) | |
phrase = phrase.tr( "-", " " ).tr( "_", " " ).tr( "/", " " ) |
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
UIImageDrawBlock draw = ^( CGContextRef ctx, CGRect rect ) { | |
[[UIColor redColor] setFill]; | |
[[UIBezierPath bezierPathWithRect:rect] fill]; | |
}; | |
UIImage* texture = [UIImage imageWithSize:CGSizeMake( 100, 100 ) opaque:NO scale:1.0 draw:draw]; |
NewerOlder