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
#warning This still misses safeguards and has private API references in it. Use only when you really know what you're doing! | |
// pspdf_swizzleSelectorWithBlock not provided. Use your swizzling helper of choice | |
// (e.g. http://petersteinberger.com/blog/2014/a-story-about-swizzling-the-right-way-and-touch-forwarding/) | |
// Fixes rdar://26295020 | |
static void PSPDFInstallWorkaroundForSheetPresentationIssue26295020(void) { | |
__block auto removeWorkaround = ^{}; | |
const auto installWorkaround = ^{ | |
const SEL presentSEL = @selector(presentViewController:animated:completion:); |
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
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
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
// Dispatch | |
// | |
// Usage: | |
// Async dispatch to main queue | |
// -->block | |
// Async dispatch to queue | |
// queue --> block | |
// Sync dispatch to main queue | |
// -->|block | |
// Sync dispatch to queue |
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/sh | |
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2 | |
ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3 | |
PLIST_BUDDY=/usr/libexec/PlistBuddy | |
function add_compatibility() { | |
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
"$1/Contents/Info.plist" |
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
#import <Foundation/Foundation.h> | |
@interface NSNumber (range) | |
- (NSIndexSet*):(NSUInteger)max; | |
- (NSIndexSet*):(NSUInteger)max step:(NSUInteger)step; | |
@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
/* | |
* Copyright © 2012 Scott Perry (http://numist.net) | |
* | |
* Released under the MIT License; its terms are at the end of this file. | |
*/ | |
#import <objc/runtime.h> | |
/** | |
* `selector_belongsToProtocol` solves a common problem in proxy objects for delegates where selectors that are not part of the protocol may be unintentionally forwarded to the actual delegate. |
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
require "rubygems" | |
require "json" | |
require "open-uri" | |
puts "API Token:" | |
api_token = gets.strip | |
puts "App ID:" | |
app_id = gets.strip |