Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
#! /bin/bash | |
set -e | |
if [[ -f ~/.vimrc ]] | |
then | |
echo "You already have a ~/.vimrc. Aborting to avoid losing data..." | |
exit 1 | |
fi |
/* | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is furnished | |
to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. |
/** | |
* Update doc if exists, insert a new one if not | |
* @param: docId | |
* @param: callback(doc), return updated document by the caller | |
* @param: done( err, doc ) status callback | |
*/ | |
this.upsert = function( db, docId, callback, done ){ | |
var insert = function( body ){ | |
//Let caller modify doc if already exists, caller can replace with entirely new doc, however, doc id will be reestablished if doc already exists | |
var id = body && (body._id || body.id); |
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:$i:1}" | |
case $c in |