Skip to content

Instantly share code, notes, and snippets.

View padenot's full-sized avatar
🦊
counting bytes

Paul Adenot padenot

🦊
counting bytes
View GitHub Profile

Install netlify:

npm install -g netlify-cli

Set it up like so, this will open a few web pages and create a netlify account with github login, authorize netlify, setup the github hook for deploy, etc.:

repositories/ringbuf.js::master$ netlify init
Logging into your Netlify account...
Opening https://app.netlify.com/authorize?response_type=ticket&ticket=e527b77c4d5c2a95a57c063ccb193459
if (window.SIMD) {
// yay, SIMD available, let's do a little stereo mixdown routine
for (var i = 0; i < bufsize; i+=4) {
var lhs = SIMD.float32x4(left[i+0], left[i+1],
left[i+2], left[i+3]),
rhs = SIMD.float32x4(right[i+0], right[i+1],
right[i+2], right[i+3]),
mixdown = SIMD.float32x4();
mixdown = lhs.add(rhs);
@padenot
padenot / index.html
Created December 5, 2014 23:32
Start of a test for setValueCurveAtTime
<script>
function lalaj() {
var out = document.querySelector("pre");
var a = new OfflineAudioContext(1, 44100, 44100);
var b = a.createBuffer(1, 44100, 44100);
var g = a.createGain();
var bb = b.getChannelData(0);
for (var i = 0; i < bb.length; i++) {
bb[i] = 1.0;
}
@padenot
padenot / blur.js
Created June 25, 2014 09:08
fast black and white gaussian blur on canvas in js
/* vertical blur of blur_px. for efficiency, we copy a vertical
* line to a buffer so that access are made in a cache efficient
* manner */
function vblur(b, blur_px) {
var buf = new Uint8ClampedArray(h * 4);
for (var vertical = 0; vertical < w; vertical++) {
copy_vertical_in_buffer(b, vertical, buf);
blur_scanline(buf, 0, h, blur_px);
// Converts a spec made with ReSpec to a cheat sheet
// Shift + f4 in Firefox, copy, paste, enjoy
var idl = document.querySelectorAll(".idl");
var cs = document.createElement("div");
cs.className = "lalala123123"
for (var i of idl) {
cs.appendChild(i);
- Web Audio Feature requests: https://github.com/WebAudio/web-audio-api/issues
- Web Audio mailing list: http://lists.w3.org/Archives/Public/public-audio/
- General web feature requests: http://www.whatwg.org/mailing-list
- Other GitHub repos for other whatwg specs, https://github.com/whatwg/
- Twitter to a person you know that implements / specs this kind of stuff, but prefer public venues so you get maximum visibility, and maximize your chances to get an answer
#!/usr/bin/env python
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
import os
import sys
data = {}
➜ FxStumbler git:(master) make
which: no uglifyjs2 in (/usr/local/bin:/Users/padenot/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/padenot/local:/Users/padenot/depot_tools/)
help - display this text
all - compile zip file
➜ FxStumbler git:(master) make help
which: no uglifyjs2 in (/usr/local/bin:/Users/padenot/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/padenot/local:/Users/padenot/depot_tools/)
help - display this text
all - compile zip file
➜ FxStumbler git:(master) make all
which: no uglifyjs2 in (/usr/local/bin:/Users/padenot/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/padenot/local:/Users/padenot/depot_tools/)
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <errno.h>
int main(int argc, char *argv[])
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef __SANITIZE_ADDRESS__
#define ALLOC_STACK(ptr) __asan_describe_address(ptr)
#else
#define ALLOC_STACK(ptr) fprintf(stderr, \
"Do an ASAN build to get allocation stacks.\n");
#endif