Skip to content

Instantly share code, notes, and snippets.

View Maciek416's full-sized avatar

Maciej Adwent Maciek416

View GitHub Profile
@Maciek416
Maciek416 / gist:3171173
Created July 24, 2012 16:57 — forked from igrigorik/gist:3148848
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
/*
Javascript port of CubicVR 3D engine for WebGL
by Charles J. Cliffe
http://www.cubicvr.org/
May be used under the terms of LGPL v3.0 or greater.
*/
var CubicVR = null;
var CubicVR_GLCore = new Object();
p.FFT = function(_bufferSize) {
var bufferSize = _bufferSize;
var self = {
initialize: function() {
self.buildReverseTable();
self.buildTrigTables();
return self;
}
var FFT = function(_bufferSize) {
var bufferSize = _bufferSize;
var self = {
// constructor
initialize: function(){
self.reverseTable = self.buildReverseTable();
return self;
},
var calculateFFT = function(real, imag) {
var bufferSize = real.length;
if ( bufferSize == 1 ) {
return [[real[0], imag[0]]];
}
if(bufferSize % 2 != 0) throw "Invalid buffer size, length must be an even number";
var even_real = [];