Skip to content

Instantly share code, notes, and snippets.

View geraintluff's full-sized avatar

Geraint geraintluff

View GitHub Profile
// Quick'n'dirty EventEmitter class
function EventEmitter() {
}
EventEmitter.prototype = {
on: function (event, listener) {
this._events = this._events || {};
this._events[event] = this._events[event] || [];
this._events[event].push(listener);
this.emit('newListener', event, listener);
return this;
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
@geraintluff
geraintluff / error-schema.json
Last active September 7, 2022 01:27
A small set of useful functions for writing JSON APIs in PHP.
{
"title": "Error (HTTP)",
"type": "object",
"properties": {
"statusCode": {"type": "integer"},
"statusText": {"type": "string"},
"message": {"type": "string"},
"data": {"title": "Supplementary data"}
},
"required": ["statusCode", "statusText", "message"]