This file contains hidden or 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
// Assume that there is a -(TCTask*)load method on these objects | |
-(void)fillTrackPool { | |
[[SPSession sharedSession] load].then(^(SPSession *sess) { | |
return sess.userPlaylists.load; | |
}).then(^(SPPlaylistContainer *container) ^{ | |
NSMutableArray *playlists = [NSMutableArray array]; | |
[playlists addObject:sess.starredPlaylist]; | |
[playlists addObject:sess.inboxPlaylist]; |
This file contains hidden or 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
[[[TCRACSocket connectTo:@"localhost" port:1236] selectMany:^id<RACSubscribable>(id x) { | |
return [x lines]; | |
}] subscribeNext:^(id x) { | |
self.text.text = x; | |
} error:^(NSError *error) { | |
NSLog(@"Failure: %@", error); | |
exit(0); | |
}]; |
This file contains hidden or 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 TCMemoryDebugPrinter : NSObject | |
+ (Class)activateMemoryDebuggingFor:(Class)sourceClass; | |
@end |
This file contains hidden or 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
@protocol IThingieProvider <NSObject> | |
-(id)thingie; | |
@end | |
@protocol IDependent <NSObject> | |
@end |
This file contains hidden or 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 SPInvocationGrabber : NSObject | |
-(id)initWithObject:(id)obj; | |
-(id)initWithObject:(id)obj stacktraceSaving:(BOOL)saveStack; | |
@property (readonly, retain, nonatomic) id object; | |
@property (readonly, retain, nonatomic) NSInvocation *invocation; | |
@property (nonatomic, copy) void(^afterForwardInvocation)(); | |
@property BOOL backgroundAfterForward; | |
@property BOOL onMainAfterForward; |
This file contains hidden or 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)drawRect:(CGRect)dirtyRect | |
{ | |
CGRect imageBounds = CGRectMake(0.0f, 0.0f, kMyViewWidth, kMyViewHeight); | |
CGRect bounds = [self bounds]; | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
UIColor *color; | |
CGFloat resolution; | |
CGFloat alignStroke; | |
CGFloat stroke; |
This file contains hidden or 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 SPAudioSessionManager () | |
{ | |
__weak PlayController *_playController; | |
BOOL _audioSessionIsConfiguredForPlayback; | |
UIBackgroundTaskIdentifier _playbackBackgroundTask; | |
} | |
@end | |
@interface PlayController : NSObject | |
@property BOOL playing; |
This file contains hidden or 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
14:11:19 ~ 🆗 cat bin/git-pristine | |
#!/bin/bash | |
git clean -dffx | |
git submodule foreach --recursive git clean -dffx |
This file contains hidden or 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 "TCAppDelegate.h" | |
// Let's use https://github.com/nevyn/SPAsync | |
#import <SPAsync/SPTask.h> | |
@interface UIView (SPTaskAnimations) | |
// Category that returns an abstraction representing an asynchronous operation, rather than just a raw block. We can use this abstraction later to compose multiple of them. | |
+ (SPTask*)task_animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations; | |
@end |
This file contains hidden or 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
2013-08-18 01:32:20.810 EmiNetDemo[87142:303] Failed to connect Error Domain=com.emilir.eminet.disconnect Code=3 "The operation couldn’t be completed. (com.emilir.eminet.disconnect error 3.)" | |
2013-08-18 01:32:20.811 EmiNetDemo[87142:303] Disconnect |