Skip to content

Instantly share code, notes, and snippets.

Avatar

Troy Grosfield troygrosfield

View GitHub Profile
@troygrosfield
troygrosfield / create-empty-audio-files
Created Feb 6, 2015
Create empty audio files using applescript
View create-empty-audio-files
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 Aug 29, 2015
Error installing ffmpeg 2.2.1
View ffmpeg2.2.2.md
➜  ~  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 Feb 27, 2014
This handles parsing of a duration string in javascript which allows for simple arithmetic.
View duration.js
/* 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:
*