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
// | |
// SVGPathSerializer.m | |
// | |
// Copyright (c) 2013 Ariel Elkin, Fjölnir Ásgeirsson, Ponderwell, and Contributors | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
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 "BPMDetector.h" | |
#import <Accelerate/Accelerate.h> | |
#import <aubio/aubio.h> | |
static uint_t const fftSize = 2048, | |
hopSize = fftSize/4; | |
@implementation BPMDetector { | |
AVCaptureSession *_captureSession; | |
AVCaptureAudioDataOutput *_dataOutput; |
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 <DatabaseKit/DatabaseKit.h> | |
#import "FLazyArray+CoineyKitAdditions.h" | |
@implementation FLazyArray (CoineyKitAdditions) | |
+ (instancetype)lazyArrayWithQuery:(DBSelectQuery * const)aQuery | |
{ | |
return !aQuery ? nil : [self lazyArrayWithCount:[aQuery count] | |
resolver:^(NSIndexSet *aIndexes, __strong id *aoObjects) | |
{ |
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> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
@interface NSObject (KVOAutoRemoval) | |
- (void)cy_addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context; | |
@end | |
@interface _CYDeallocHandler : NSObject | |
@property(nonatomic, copy) void (^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
#import "CYContainerViewController.h" | |
@implementation CYContainerViewController | |
- (void)setContainedViewController:(UIViewController * const)aController | |
{ | |
[self willChangeValueForKey:@"containedViewController"]; | |
[self.containedViewController willMoveToParentViewController:nil]; | |
[self.containedViewController removeFromParentViewController]; |
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
- (id)forwardingTargetForSelector:(SEL const)aSelector | |
{ | |
if( aSelector == @selector(a) | |
|| aSelector == @selector(b) | |
|| aSelector == @selector(c)) | |
return _wrappedObject; | |
else | |
return nil; | |
} | |
- (void)setValue:(id const)aValue forUndefinedKey:(NSString * const)aKey |
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)sendEvent:(UIEvent *)event | |
{ | |
for(UITouch *touch in event.allTouches) { | |
CGPoint loc = [touch locationInView:self]; | |
UIView *highlight = [[UIView alloc] initWithFrame:CGRectInset((CGRect) { loc.x - 1.0, loc.y-1.0, 2, 2 },-8, -8)]; | |
highlight.layer.zPosition = 10; | |
highlight.opaque = YES; | |
highlight.layer.cornerRadius = 8; | |
highlight.backgroundColor = [UIColor purpleColor]; | |
highlight.alpha = 0.7; |
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
// Signature: void write_samples(float *buf, size_t buf_len) | |
var write_samples = Module.cwrap('write_samples', null, ['number', 'number']); | |
var buf_len = 0; | |
var buf_addr; | |
var buf; | |
node.onaudioprocess = function(e) { | |
var out_data = e.outputBuffer.getChannelData(0); | |
if(buf_len < out_data.length) { | |
buf_len = out_data.length; |
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> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
#import <ffi/ffi.h> | |
#import <sys/mman.h> | |
// Wrapper closure called as a result of a message to `initWith..` | |
static void _ai_closure(ffi_cif * const aCif, id * const aoRet, void * const aArgs[], NSArray * const paramInfo); | |
static ffi_closure *_ai_ffi_allocClosure(void ** const codePtr); |