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
➜ 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/)
#!/usr/bin/env python
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
import os
import sys
data = {}
- 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
// 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);
@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);
@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;
}
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);
HttpRequest::HttpRequest (const std::string& url)
:attributeCount_(0),
url_(url),
hostname_(url.substr(0, url.find_first_of('/'))),
path_(url.substr(url.find_first_of('/'))),
resolver_(io_service_),
socket_(io_service_)
{
//check if a port is in the hostname.
size_t index = hostname_.find_first_of(':');
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#define BUFFER_SIZE 128
#include <iostream>
#include <vector>
#include <assert.h>
int main()
{
std::vector<int> vec_int;
vec_int.push_back(1);