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
- (RACSignal *)rac_capturedMetadataObjectsSignal | |
{ | |
[self setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; | |
RACSignal *signal = objc_getAssociatedObject(self, _cmd); | |
if (signal != nil) return signal; | |
signal = [[[[self rac_signalForSelector:@selector(captureOutput:didOutputMetadataObjects:fromConnection:) fromProtocol:@protocol(AVCaptureMetadataOutputObjectsDelegate)] reduceEach:^id(AVCaptureOutput * output, NSArray * objects, AVCaptureConnection * connection){ | |
return objects; | |
}] filter:^BOOL(NSArray * objects) { | |
return objects.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
- (void)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
@weakify(self); | |
[[[[[[[[self.output.rac_capturedMetadataObjectsSignal filter:^BOOL(AVMetadataMachineReadableCodeObject * codeObject) { | |
return [codeObject isKindOfClass:[AVMetadataMachineReadableCodeObject class]] && [codeObject.type isEqual:@"org.iso.QRCode"]; | |
}] map:^id(AVMetadataMachineReadableCodeObject * codeObject) { | |
return codeObject.stringValue; | |
}].distinctUntilChanged map:^id(NSString * JSONString) { | |
return [NSJSONSerialization JSONObjectWithData:[[JSONString stringByReplacingOccurrencesOfString:@"\\" withString:@""] dataUsingEncoding:NSASCIIStringEncoding] options:0 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
import Text | |
import Color exposing (..) | |
import Mouse | |
import Window | |
import Time exposing (inSeconds, fps) | |
import Signal exposing (..) | |
import Graphics.Element exposing (..) | |
import Graphics.Collage exposing (..) | |
sampleWithFPS frames signal = sampleOn (inSeconds <~ fps frames) signal |
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
let numbers = map show [1..100] | |
let fizzes = cycle $ (take 4 $ repeat "") ++ ["FIZZ"] | |
let buzzes = cycle $ (take 2 $ repeat "") ++ ["BUZZ"] | |
let fizzbuzzes = zipWith (++) fizzes buzzes | |
zipWith (max) numbers fizzbuzzes |
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 Html exposing (..) | |
import Html.Attributes as Attr exposing (..) | |
import Html.Events exposing (..) | |
import Http | |
import Json.Encode as Encode exposing (..) | |
import Json.Decode as Decode exposing ((:=)) | |
import String | |
import Task exposing (..) | |
import Graphics.Element exposing (show) |
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
[[[[self.gateways takeUntil:[[RACSignal empty] delay:timeout]] filter:^BOOL(NSDictionary *object) { | |
return [object[kMACAddressAccessor] caseInsensitiveCompare:mac] == NSOrderedSame; | |
}] concat:[RACSignal error:[NSError errorWithDomain:RPCErrorDomain code:ERROR_TIMEOUT userInfo:@{NSLocalizedDescriptionKey:@"Timed out while waiting for a response"}]]] take: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
import Signal | |
import Graphics.Element exposing (..) | |
import Graphics.Input exposing (button) | |
import Graphics.Collage exposing (collage, toForm) | |
import List exposing (..) | |
import List.Extra exposing (..) | |
import Color | |
import Text | |
import Random | |
import Window |
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 Signal | |
import Graphics.Element exposing (..) | |
import Graphics.Input exposing (button) | |
import Graphics.Collage exposing (collage, toForm) | |
import List exposing (..) | |
import List.Extra exposing (..) | |
import Color | |
import Text | |
import Random | |
import Window |
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 Signal | |
import Graphics.Element exposing (..) | |
import Graphics.Input exposing (..) | |
import Graphics.Input.Field exposing (..) | |
import List | |
import String | |
import Window | |
import Task exposing (Task) | |
import Text | |
import Keyboard |
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
// | |
// CTMaybe.c | |
// Firestarter | |
// | |
// Created by Charlotte Tortorella on 17/03/2016. | |
// Copyright © 2016 DALI Lighting. All rights reserved. | |
// | |
#include "CTMaybe.h" |
OlderNewer