Skip to content

Instantly share code, notes, and snippets.


Tobie Langel tobie

View GitHub Profile
View a.txt
1. If |F| corresponds to an attribute, operation or stringifier, then return
the global environment associated with the
[=interface=] that definition appears on.
1. Otherwise, if |F| corresponds to an indexed or named property, then return
the global environment associated with the interface that
the indexed or named property getter, setter or deleter was defined on.
View nav.js
// Moved to
View issue-src.txt
Primarily by grouping types into larger categories, but also by recategorizing callback interfaces as more like dictionaries than normal interfaces.
Fixes #50 and #59.
This comment and the below content is programatically generated.
You may add a comma-separated list of anchors you'd like a
direct link to below (e.g. #idl-serializers, #idl-sequence):
<pre class=metadata>
Group: test
Shortname: foo
Level: 1
Status: ED
Group: dap
Abstract: Abstract content.
tobie /
Last active Jul 31, 2016
Why is oldids taking precedence here?
<h4 oldids="dom-sequence" id="idl-sequence" interface="" dfn="" lt="sequence|sequence&lt;T&gt;">Sequences — sequence&lt;|T|&gt;</h4>
The {{sequence&lt;T&gt;}}
type is a parameterized type whose values are (possibly zero-length) sequences of
values of type |T|.
tobie / whatfreq.js
Last active Sep 7, 2015
Sensor sample frequency
View whatfreq.js
// Trying to find the formula to determine the frequency
// at which to sample GPS coordinates of a moving vehicle
// in order to have the maximum precision but not to store
// more data than necessary.
let precision = 1; // The precision of the GPS in meters
let max_speed = 180 / 3.6 // 180km/h converted to m/s = 50m/s
let max_frequency = max_speed / precision;
// Nyquist–Shannon sampling theorem[1] tells us a
tobie / _design_xxx.js
Created Jun 30, 2015
CouchDB design doc
View _design_xxx.js
module.exports = {
_id: "_design/xxx",
views: {
by_date: {
map: function(doc) {
var parts = doc._id.split(":");
emit(parts, { shortname: parts[0], date: parts[1] });
updates_by_date: {
View gist:b830e468061109d30470
function uniq(sortedArray) {
var output = [];
sortedArray.reduce(function(previous, current) {
if (current != previous) {
return current;
}, null);
return output;
View gist:7c6f13a174b1eeb84d00
"html5": {
"authors": [
"Ian Hickson",
"Robin Berjon",
"Steve Faulkner",
"Travis Leithead",
"Erika Doyle Navara",
"Edward O'Connor",
"Silvia Pfeiffer"
tobie / gist:ee9f00d6cefc35f104f7
Last active Aug 29, 2015
Search term highlighter for well-formed HTML content.
View gist:ee9f00d6cefc35f104f7
function highlight(str, searchString) {
var regexp = new RegExp("(<[^>]+>)|(" + searchString + ")", "gi");
return (str || "").replace(regexp, function wrap(_, tag, txt) {
if (tag) return tag;
return "<strong class=\"highlight\">" + txt + "</strong>";