Skip to content

Instantly share code, notes, and snippets.

View notthetup's full-sized avatar
🔊

Chinmay Pendharkar notthetup

🔊
View GitHub Profile
@notthetup
notthetup / GetAudioFromURL.js
Last active August 29, 2015 14:02
A function to get Audio From URL
/*
* Downloads a sound file using XHR and decodes it using WebAudio
*
* @method GetAudioFromURL
* @param {String} URL URL of the audio file to be downloaded.
* @param {Function} onLoadCallback Callback for when the decoded AudioBuffer is ready. Callback returns an {Error} (if any) and an {AudioBuffer}
* @param {Function} onProgressCallback Callback for progress event from the XHR download.
* @param {AudioContext} [AudioContext] Optional AudioContext to be used for decoding.
*
@notthetup
notthetup / delaytest.js
Created April 7, 2014 07:34
Testing WebAudioAPI Delay precision
"use strict";
var AudioContext = webkitAudioContext || AudioContext;
var context = new AudioContext();
var length = 44100;
// 2 Buffers to hold samples
var bufferSourceNode = context.createBufferSource();
var counterNode = context.createBufferSource();
@notthetup
notthetup / iCurve.py
Last active August 29, 2015 13:58
Interactive iPython Notebook Test
{
"metadata": {
"name": "",
"signature": "sha256:05444a3a666df9d8410c09f11f59337f93fee5d8a8eb28978ad18c56128d427d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@notthetup
notthetup / soxplot.sh
Created April 5, 2014 14:13
Whole file spectrum using SOX and gnuplot.
sox $1 -n stat -freq 2>&1 | sed -n -e :a -e '1,15!{P;N;D;};N;ba' | gnuplot -p -e 'set logscale x; plot "-" with linesp'
@notthetup
notthetup / audioplayback.js
Last active August 29, 2015 13:57
Basic Audio Playback without an DOM element.
var flapSound = new Audio("./flyaway.wav");
flapSound.play(); // has to be done in an UI event callback
@notthetup
notthetup / tryload.js
Last active August 29, 2015 13:56
Try to load using XMLHTTPRequest
var tryload = function(url){
var ir_request = new XMLHttpRequest();
ir_request.open("GET", url, true);
ir_request.responseType = "blob";
ir_request.onload = function () {console.log("loaded")};
ir_request.send();
}
@notthetup
notthetup / ex33 tweak
Last active December 26, 2015 23:09 — forked from shurru/ex33 tweak
Fixed indentation for return.
numbers= []
def loopy(i):
while i<6:
print "at the top of i is %d" %i
numbers.append(i)
i = i+1
print "Numbers now", numbers
print "at the bottom of i is %d" %i
@notthetup
notthetup / helloworld.java
Created May 10, 2013 04:22
Java Hello World Test
/*************************************************************************
* Compilation: javac helloworld.java
* Execution: java helloworld
*
*
*************************************************************************/
public class helloworld {
public static void main(String[] args) {
@notthetup
notthetup / bind-dnssec-osx.md
Last active December 16, 2015 04:59
Setting up local bind9 server with dnssec on MacOSX Lion

Installing Bind9 with DNSSEC support on OSX Mountain Lion

Based on the instructions from haller.ws

Check bind installation

  1. run named -v to check if you have BIND 9.x (or greater) installed
@notthetup
notthetup / growl-long.zsh
Created April 4, 2013 03:25
Oh my zsh custom script to growl on completion of all commands which take more than 10secs
preexec_functions+='save_preexec_time'
save_preexec_time() {
export PREEXEC_CMD="$(history $HISTCMD | tail -n 1 | sed 's/ *[0-9]* *//')"
export PREEXEC_TIME=$(date +'%s')
}
precmd_functions+='growl_about_long_running_commands'
growl_about_long_running_commands() {
exitstatus=$?