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
(use 'clojure.core.async) | |
(def output (atom [])) | |
(defn producer [ctrl k] | |
(go (loop [i 0] | |
(when-let [c (<! ctrl)] | |
(>! c [k i]) | |
(>! ctrl c) | |
(recur (inc i)))))) |
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
// | |
// CPPViewController.m | |
// Catalog Playlist Playback | |
// | |
// Created by Robert Crooks on 10/2/13. | |
// Copyright (c) 2013 Brightcove. All rights reserved. | |
// | |
#import "CPPViewController.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
// | |
// CPPViewController.h | |
// Catalog Playlist Playback | |
// | |
// Created by Robert Crooks on 10/9/13. | |
// Copyright (c) 2013 Brightcove. All rights reserved. | |
// | |
#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
// | |
// CPUViewController.h | |
// Cue Point Usage | |
// | |
// Created by Robert Crooks on 11/14/13. | |
// Copyright (c) 2013 Robert Crooks. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
// import the SDK master header |
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
// | |
// CPUViewController.m | |
// Cue Point Usage | |
// | |
// Created by Robert Crooks on 11/14/13. | |
// Copyright (c) 2013 Robert Crooks. All rights reserved. | |
// | |
#import "CPUViewController.h" | |
// import the SDK master header and RAC EXTScope header |
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
// 1. | |
// “Safe” but retain cycle. | |
[self setCompletionBlock:^{ | |
NSLog(@"1: %@", self->_foo); | |
}]; | |
// 2. | |
// Unsafe. Could dereference nil. | |
__weak BCThing *weakSelf = self; |