Skip to content

Instantly share code, notes, and snippets.

/*
* The Inspector Bootstrap Script is guaranteed to be the first script evaluated in any page, as well as any sub-frames.
* It is evaluated immediately after the global object is created, before any other content has loaded.
*
* Modifications made here will take effect on the next load of any page or sub-frame.
* The contents and enabled state will be preserved across Web Inspector sessions.
*
* Some examples of ways to use this script include (but are not limited to):
* - overriding built-in functions to log call traces or add `debugger` statements
* - ensuring that common debugging functions are available on every page via the Console
@jernoble
jernoble / mirror_hls.py
Last active August 29, 2015 14:02
Mirror a HLS master playlist and all of its associated files.
#!/usr/bin/python
from urlparse import urljoin, urlparse
import urllib2, os.path, os, sys, re
def mirrorManifest(manifestURL):
parsedURL = urlparse(manifestURL)
manifestPath = parsedURL.path[1:]
manifestDirname = os.path.dirname(manifestPath)
manifestFilename = os.path.basename(manifestPath)
@jernoble
jernoble / CodedFrameProcessing.cpp
Last active August 29, 2015 14:02
Implements the 'Coded Frame Processing' algorithm of the Media Source Extension spec.
/* Copyright (c) 2014 Jer Noble
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
#include <stdio.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
static const size_t LENGTH = 10;
static const size_t SIZE = sizeof(int) * LENGTH;
void fillBuffer(int* buffer, size_t length)
{
for (size_t i = 0; i < length; ++i)

Overview

In order to solve the "data race" issue in WebAudio (bug 22725), this proposal restricts access to the internal PCM data of an AudioBuffer. This does not require AudioBuffers to be immutable, but that modifying their contents occurs through an API which enforces no-data-race semantics.

Since this will involve breaking API changes, this proposal incorporates suggestions from Issue 48 to simplify the AudioBuffer interface, and will also adopt a constructor, as opposed to a factory method.

The new constructor provides an upgrade path for existing pages while not breaking those pages. The factory method can continue to create the "legacy" AudioBuffer in prefixed implementations.

Interface Changes

@jernoble
jernoble / MintParser.py
Last active December 18, 2015 18:59
This module allows you to ingest CSV data exported by Mint.com and perform queries on the resulting Sqlite DB.
#!/bin/python
# This module allows you to ingest CSV data exported by Mint.com and
# perform queries on the resulting Sqlite DB.
#
# Usage:
# >>> from MintParser import MintParser
# >>> m = MintParser('transactions.csv.txt')