This Gist has been moved to https://github.com/lbgists/audio-spectrum-matplotlib.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FFT = (function() { | |
"use strict"; | |
var FFT = function() { | |
initialize.apply(this, arguments); | |
}, $this = FFT.prototype; | |
var FFT_PARAMS = { | |
get: function(n) { | |
return FFT_PARAMS[n] || (function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(ggplot2) | |
function(input, output) { | |
dataset <- reactive({ | |
diamonds[sample(nrow(diamonds), input$sampleSize),] | |
}) | |
output$plot <- renderPlot({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim: filetype=pyopencl.python | |
import sys | |
import time | |
from PyQt4 import QtCore | |
from PyQt4 import QtGui | |
import pyopencl as cl | |
import numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Felipe Ferreri Tonello <eu@felipetonello.com> | |
* | |
* This url-shortner it only works with ASCII characters. It encodes and | |
* decodes ids. | |
* You can change base_x as you wish. | |
* | |
* It runs at least 20 times faster then a Python implementation. | |
* | |
* $ time python url-shortner.py -s I7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(MASS) | |
require(ggplot2) | |
require(scales) | |
require(gridExtra) | |
pca <- prcomp(iris[,-5], | |
center = TRUE, | |
scale. = TRUE) | |
prop.pca = pca$sdev^2/sum(pca$sdev^2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A script for analyzing twitter stats on Ferguson | |
''' | |
import json | |
import re | |
import tweepy | |
def get_api(): | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Kinda like Python's defaultdict, but for JS*/ | |
function defDict(type) { | |
var dict = {}; | |
return { | |
get: function (key) { | |
if (!dict[key]) { | |
dict[key] = type.constructor(); | |
} | |
return dict[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ================== | |
* | |
* This patch works around iOS9 UIWebView regression that causes infinite digest | |
* errors in Angular. | |
* | |
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular | |
* have the workaround baked in. | |
* | |
* To apply this patch load/bundle this file with your application and add a |
OlderNewer