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
#!/bin/bash | |
tail -f $(ls -t "$HOME/Library/Logs/CoreSimulator/"*/system.log | head -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
#ifndef NS_DESIGNATED_INITIALIZER | |
#if __has_attribute(objc_designated_initializer) | |
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer)) | |
#else | |
#define NS_DESIGNATED_INITIALIZER | |
#endif | |
#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
""" File: reveal.py | |
Add to ~/.lldbinit: | |
command script import ~/.lldb-scripts/reveal.py | |
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode? | |
A: In Xcode: | |
Add a Symbolic Breakpoint | |
Symbol: "UIApplicationMain" | |
Action: Debugger Command with value "reveal" |
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 BOOL PSPDFIsDevelopmentBuild(void) { | |
#if TARGET_IPHONE_SIMULATOR | |
return YES; | |
#else | |
static BOOL isDevelopment = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// There is no provisioning profile in AppStore Apps. | |
NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
if (data) { |
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
-Wall | |
-Wno-deprecated-declarations | |
-Werror=incompatible-pointer-types | |
-Werror=arc-retain-cycles | |
-Werror=implicit-function-declaration | |
-Werror=return-type | |
-Werror=format | |
-Werror=mismatched-parameter-types | |
-Werror=tautological-constant-out-of-range-compare |
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
// | |
// CustomCollectionFlowLayout.h | |
// evilapples | |
// | |
// http://stackoverflow.com/questions/13511733/how-to-make-supplementary-view-float-in-uicollectionview-as-section-headers-do-i | |
// | |
// | |
#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
// Convert an EXIF image orientation to an iOS one. | |
// reference see here: http://sylvana.net/jpegcrop/exif_orientation.html | |
+ (UIImageOrientation) exifOrientationToiOSOrientation:(int)exifOrientation { | |
UIImageOrientation o = UIImageOrientationUp; | |
switch (exifOrientation) { | |
case 1: o = UIImageOrientationUp; break; | |
case 3: o = UIImageOrientationDown; break; | |
case 8: o = UIImageOrientationLeft; break; | |
case 6: o = UIImageOrientationRight; break; |
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
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol * | |
// block typedef: | |
typedef void(^Block)(); | |
typedef void(^ConditionalBlock)(BOOL); | |
typedef NSString*(^BlockThatReturnsString)(); | |
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL); | |
// block property with typedef: |
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 UIBezierPath (forEachElement) | |
- (void)forEachElement:(void (^)(CGPathElement const *element))block; | |
@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
tell application "Reminders" | |
set todo_accounts to every account | |
-- accounts have lists. loop thru accounts to get their lists. | |
repeat with i from 1 to length of todo_accounts | |
tell account i | |
set todo_lists to get every list | |
-- lists have reminders. loop thru lists to get their reminders | |
repeat with j from 1 to length of todo_lists | |
tell list j | |
set todos to (get reminders) |