Skip to content

Instantly share code, notes, and snippets.

View samuelclay's full-sized avatar

Samuel Clay samuelclay

View GitHub Profile
@jwilling
jwilling / JNWThrottledBlock.h
Last active October 26, 2020 17:02
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;
@samuelclay
samuelclay / LED Dress.ino
Last active February 15, 2024 16:07
For New Year's Eve 2014, my girlfriend and I went to a dance party where wearable electronics were not only encouraged but also on display from a variety of hobbyists. I decided to use this as an opportunity to combine two of my favorite hobbies: sewing and electronics. We attached six addressable LED strands from Sparkfun ($20 each) to the lini…
#include <Adafruit_NeoPixel.h>
#include "WS2812_Definitions.h"
#define PIN_A 9
#define PIN_B 3
#define PIN_C 2
#define PIN_D 12
#define PIN_E 10
#define PIN_F 6
#define LED_COUNT 43
@tkrynski
tkrynski / gist:8943112
Created February 11, 2014 20:11
How to compare two redis dbs
<div class="youtube-section" id="video-{{ youtube_id }}">
<div class="youtube-container">
<div class="youtube-watermark">
{{ theme:output src="svg/uga-college-logo-white.svg" }}
</div>
<div class="youtube-player" data-id="{{ youtube_id }}"></div>
{{ if video_title || video_description }}
<div class="row padd-top-default">
<article>
{{ if video_title }}