Skip to content

Instantly share code, notes, and snippets.

Alexandrine Boissière theasta

  • Paris
View GitHub Profile
View recursive-dom-walker.js
// includes siblings of the first element
var recursiveDOMWalker = function (n) {
do {
console.log(n);
if (n.hasChildNodes()) {
recursiveDOMWalker(n.firstChild);
}
} while (n = n.nextSibling)
};
View fiddle.html
<h1 id="qunit-header">Objects References</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
View fiddle.html
<h1 id="qunit-header">Inheritance with Object.create</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
View fiddle.html
<h1 id="qunit-header">Pseudo-classical inheritance internals</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
@theasta
theasta / radix-conversion.js
Created Mar 29, 2015
Decimal, Hexadecimal, Binary Conversion in JavaScript
View radix-conversion.js
// Convert from decimal to binary
(11).toString(2) // “1011"
// Convert from decimal to hexadecimal
(255).toString(16) // ‘ff'
// Convert from binary to decimal
parseInt("1011", 2); // 11
// Convert from binary to hexadecimal
View fiddle.html
<h1 id="qunit-header">Regular Expressions Methods</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
View fiddle.html
<h1 id="qunit-header">Regular Expressions Patterns</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
@theasta
theasta / openLC
Last active Aug 29, 2015
Download and open a file at a specific line and column
View openLC
#!/bin/bash
# $1 has to match this pattern: http://example.com/file.js:3:10
# First get back the url, the line and the column
regex="(https?:.*):([0-9]+):([0-9]+)"
dir="/tmp/"
[[ $1 =~ $regex ]]
View fiddle.html
<h1 id="qunit-header">Object.defineProperty</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
@theasta
theasta / fiddle.html
Last active Aug 29, 2015
[QUni] Copying object
View fiddle.html
<h1 id="qunit-header">Copying objects</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
You can’t perform that action at this time.