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
// https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ | |
function buildWaveHeader(opts) { | |
var dataSize = opts.dataSize; | |
var numChannels = opts.numChannels || 1; | |
var sampleRate = opts.sampleRate || 16000; | |
var bytesPerSample = opts.bytesPerSample || 2; | |
var blockAlign = numChannels * bytesPerSample; | |
var byteRate = sampleRate * blockAlign; | |
var buffer = new ArrayBuffer(44); |
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
// | |
// time_profiler.h | |
// time_profiler | |
// | |
// Created by JustBen on 22/03/2017. | |
// Copyright © 2017 JustBen. All rights reserved. | |
// | |
#ifndef time_profiler_h | |
#define time_profiler_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
//: Playground - noun: a place where people can play | |
import UIKit | |
import UIKit | |
var regex = "(((http[s]{0,1}|ftp)://)?(([\\W\\.\\-]+\\.([a-zA-Z]{2,4}))|((::)?[0-255]\\.[0-255]\\.[0-255]\\.[0-255])|((([a-zA-Z0-9]{4})?:)?(([a-zA-Z0-9]{4})?:)?(([a-zA-Z0-9]{4})?:)?(([a-zA-Z0-9]{4})?:)?(([a-zA-Z0-9]{4})?:)?(([a-zA-Z0-9]{4})?:)?(([a-zA-Z0-9]{4})?:)?([a-zA-Z0-9]{4})?))(:\\d+)?(/[a-zA-Z0-9\\W\\.\\-~!@#$%^&*+?:_/=<>()]*)?)" | |
var available_urls = ["http://foo.com/blah_blah", | |
"http://foo.com/blah_blah/", |
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)controllerWillChangeContent:(NSFetchedResultsController *)controller | |
{ | |
self.shouldReloadCollectionView = NO; | |
self.blockOperation = [[NSBlockOperation alloc] init]; | |
} | |
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id<NSFetchedResultsSectionInfo>)sectionInfo | |
atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type | |
{ | |
__weak UICollectionView *collectionView = self.collectionView; |