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
$ script/plugin install [email protected]:contrast/uploadify-s3.git | |
Initialized empty Git repository in ../vendor/plugins/uploadify-s3/.git/ | |
Permission denied (publickey). | |
fatal: The remote end hung up unexpectedly |
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
@interface NSString (A) | |
- (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target options:(NSStringCompareOptions)options range:(NSRange)searchRange withHandler:(NSString * (^)(NSString * occurrence, NSRange rangeOfString))replaceBlock; | |
@end | |
@implementation NSString (A) | |
- (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target options:(NSStringCompareOptions)options range:(NSRange)searchRange withHandler:(NSString * (^)(NSString * occurrence, NSRange rangeOfString))replaceBlock; | |
{ | |
NSMutableString * ms = [[self mutableCopy] autorelease]; |
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
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
// Create a pretend Desktop and Documents folder | |
NSString * desktopFolderPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"Desktop"]; | |
NSString * documentsFolderPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"Documents"]; | |
[[NSFileManager defaultManager] createDirectoryAtPath:desktopFolderPath withIntermediateDirectories:NO attributes:nil error:nil]; | |
[[NSFileManager defaultManager] createDirectoryAtPath:documentsFolderPath withIntermediateDirectories:NO attributes:nil error:nil]; |
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
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
// Create a pretend Desktop and Documents folder | |
NSString * desktopFolderPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"Desktop"]; | |
NSString * documentsFolderPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"Documents"]; | |
[[NSFileManager defaultManager] createDirectoryAtPath:desktopFolderPath withIntermediateDirectories:NO attributes:nil error:nil]; | |
[[NSFileManager defaultManager] createDirectoryAtPath:documentsFolderPath withIntermediateDirectories:NO attributes:nil error:nil]; |
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 __AllowOnceEvery(double seconds, void (^block)(void), NSTimeInterval * lastTime) | |
{ | |
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate]; | |
if (now - *lastTime > seconds) { | |
*lastTime = now; | |
block(); | |
} | |
} | |
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
0 2 4 06105 (SMW) | |
0 2 4 04285 (FFV) | |
1 0 7 0488e (ML TE) | |
1 4 3 0488e (L TE) | |
0 4 1 0408e (SF) | |
1 0 1 0408e (BT64) | |
0 4 1 0408e (BT32) | |
0 0 5 0408e (MQD iOS) | |
1 4 1 0488e (App Store) |
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
@interface GCDCoalescent : NSObject | |
- (void)dispatchOn:(dispatch_queue_t)queue after:(double)seconds block:(dispatch_block_t)block; | |
@end | |
@implementation GCDCoalescent | |
{ | |
uint64_t count; | |
} |
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
@interface GCDCoalescent : NSObject | |
- (void)dispatchOn:(dispatch_queue_t)queue after:(double)seconds block:(dispatch_block_t)block; | |
@end | |
@implementation GCDCoalescent | |
{ | |
uint64_t count; | |
} |
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_source_t dispatch_coalesce_source_create(dispatch_queue_t queue) | |
{ | |
dispatch_source_t src = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); | |
dispatch_resume(src); | |
return src; | |
} | |
void dispatch_coalesce(dispatch_source_t src, double time, void (^block)(void)) | |
{ |
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 MethodSwizzle(Class c, SEL orig, SEL new) | |
{ | |
Method origMethod = class_getInstanceMethod(c, orig); | |
Method newMethod = class_getInstanceMethod(c, new); | |
if (class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) { | |
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); | |
} else { | |
method_exchangeImplementations(origMethod, newMethod); | |
} | |
} |
OlderNewer