Skip to content

Instantly share code, notes, and snippets.

View nthitz's full-sized avatar

Nick Yahnke nthitz

  • Pitch Interactive
  • Oakalnd
View GitHub Profile
@nthitz
nthitz / search.js
Created March 7, 2021 19:45
Search window for something
// stringifies an object avoiding circular references
let mySearch = (variable) => {
var cache = [];
let a = JSON.stringify(variable, (key, value) => {
if (typeof value === 'object' && value !== null) {
// Duplicate reference found, discard key
if (cache.includes(value)) return;
// Store value in our collection
cache.push(value);
@nthitz
nthitz / README.md
Last active October 19, 2015 20:34
photozoom_block
1) cloudfront always use http only when connecting to origin (s3 doesn't support ssl on custom domain)
2) cloudfront connect to S3 public web facing url not just bucket (to get index.html support)
3) startssl create your own cert using `openssl` and paste in csr.
@nthitz
nthitz / README.md
Last active September 2, 2015 05:56
blocks_party

hello markdown

@nthitz
nthitz / gist:ec256bbfaf2584afb708
Last active August 29, 2015 14:01
ffmpeg commands
#installed presumably with brew
--prefix=/usr/local/Cellar/ffmpeg/2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
# create a gif from input starting at ss for t duration (ffmpeg 2.2)
ffmpeg -i input.avi -ss 00:09:11 -t 10 out.gif
# extract a portion and save it
ffmpeg -ss 00:05:31 -i seinfeld.3x02.the_truth.dvdrip_xvid-fov.avi -t 8 -c:v mpeg4 -c:a libfaac -b:v 1200k sammy.mp4
for giffing: part of imagemagic
@nthitz
nthitz / bookmarklet
Last active July 20, 2022 19:46
plug dj woot!
javascript:var voteTimeout=null;var djCheckTimeout=null;var user=null;once();function once(){if(typeof ran!=="undefined"){return;}ran=true;API.on(API.DJ_ADVANCE,advance);$('#audience').remove();$('#playback').css('opacity',0);$('#room-wheel').css('background','black');voteTimeout=setTimeout(vote,2000);djCheckTimeout=setTimeout(checkIfDJing,1000);user=API.getUser();}function advance(obj){clearTimeout(voteTimeout);clearTimeout(djCheckTimeout);if(obj==null)return;var timer=30000+30000*Math.random();voteTimeout=setTimeout(vote,timer);djCheckTimeout=setTimeout(checkIfDJing,5000);}function vote(){$('#room #woot').click();}function checkIfDJing(){return;var curDJs=API.getDJs();var djing=false;for(var i=0;i<curDJs.length;i++){var dj=curDJs[i];if(dj.id===user.id){djing=true;break;}}if(djing){return;}var inWaitList=API.getWaitListPosition();if(inWaitList!=-1){return;}$('.button-dj:visible').click();}
@nthitz
nthitz / README.md
Last active December 17, 2015 23:58 — forked from mbostock/.block