Skip to content

Instantly share code, notes, and snippets.

View troygrosfield's full-sized avatar

Troy Grosfield troygrosfield

  • Rocket Lab
  • Denver, CO
View GitHub Profile
@troygrosfield
troygrosfield / create-empty-audio-files
Created February 6, 2015 22:07
Create empty audio files using applescript
global duration
set duration to 43
set endDuration to 46
repeat until duration = endDuration
set recordName to "empty-" & duration & "sec.m4a"
set newPath to "~/Users/troy/Desktop/audios/" & recordName
set duration2 to duration
tell application "Finder"
@troygrosfield
troygrosfield / ffmpeg2.2.2.md
Last active August 29, 2015 13:59
Error installing ffmpeg 2.2.1
➜  ~  brew install -v ffmpeg --with-theora --with-libogg --with-libvorbis --with-freetype --with-fdk-aac --with-tools
==> Downloading http://ffmpeg.org/releases/ffmpeg-2.2.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/ffmpeg-2.2.1.tar.bz2
==> Verifying ffmpeg-2.2.1.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/ffmpeg-2.2.1.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/ffmpeg/2.2.1 --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 --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libfdk-aac
ERROR: libfaac not found

If you think configure made a mistake, make sure you are using the latest
@troygrosfield
troygrosfield / duration.js
Created February 27, 2014 14:20
This handles parsing of a duration string in javascript which allows for simple arithmetic.
/* Duration is a class that allows adding to or subtracting from dates.
* It's backed by a javascript date object, so this only works for milliseconds,
* not, microseconds.
*
* Note: This only deals with hours, minutes and seconds up to 23:59:59.999
*
* * param duration: the string duration value. (i.e. "01:25:35.123")
*
* Examples:
*