Skip to content

Instantly share code, notes, and snippets.

View sebastienwindal's full-sized avatar

Sebastien Windal sebastienwindal

View GitHub Profile
@sebastienwindal
sebastienwindal / .block
Last active February 24, 2016 16:40 — forked from mbostock/.block
Calendar View
license: gpl-3.0
height: 910
border: no
@sebastienwindal
sebastienwindal / JNWThrottledBlock.h
Created October 6, 2015 22:28 — forked from jwilling/JNWThrottledBlock.h
Simple throttling of blocks using dispatch sources.
#import <Foundation/Foundation.h>
@interface JNWThrottledBlock : NSObject
// Runs the block after the buffer time _only_ if another call with the same identifier is not received
// within the buffer time. If a new call is received within that time period the buffer will be reset.
// The block will be run on the main queue.
//
// Identifier and block must not be nil.
+ (void)runBlock:(void (^)())block withIdentifier:(NSString *)identifier throttle:(CFTimeInterval)bufferTime;