Skip to content

Instantly share code, notes, and snippets.

zip -0Xq my-book.epub mimetype
zip -Xr9Dq my-book.epub *
@DavidBruant
DavidBruant / c.js
Created December 10, 2013 15:40
clone for @JeremiePat
var obj = {
a: 1,
get b(){ return 2 },
c: 3
}
Object.defineProperty(obj, 'c', {configurable: false, writable: false});
function clone(o){
var c = Object.create(Object.getPrototypeOf(o));
@DavidBruant
DavidBruant / review.md
Last active December 30, 2015 03:39
Conrad.js code review

Reviewing this version

Questions

Which browsers are targeted?

Would you consider making an AMD or UMD module instead of exporting to the global?

Comments

@DavidBruant
DavidBruant / DRM.md
Last active December 26, 2015 14:49
DRM definition and research

Context

Copyright legislation in most countries provide content producers and distributors with the right to decide how what they've created is expected to be distributed. They can put any sort of restriction, like expect that if people share it, the work has to be shared unmodified. Another restriction would to credit the author when sharing, etc.

Links

var win = gBrowser.selectedBrowser.contentWindow;
var console = win.console;
var P = Object.getPrototypeOf;
Components.utils.import("resource://gre/modules/jsdebugger.jsm").addDebuggerToGlobal(this);
//console.log(Debugger)
var dbg = new Debugger();
var dbgwin = dbg.addDebuggee(win)
//console.log(dbgwin)
@DavidBruant
DavidBruant / break.js
Created September 4, 2013 18:05
Breaking up large computation
var MAX = 10;
var times = [];
var now = performance.now.bind(performance)
for(var i=0; i<MAX; i++){
setTimeout(function f(){
times.push(now());
}, 0);
}
@DavidBruant
DavidBruant / fix the elevator.markdown
Last active December 21, 2015 17:19
MozFest session proposals by @oncletom & @DavidBruant http://sessions.mozillafestival.org/ WORK IN PROGRESS

Title

Hack your building! ("make the web physical" track)

Description

Imagine you could contribute code to improve your building elevator. How would you prioritize it?

What will your session allow people to make, learn or do?

@DavidBruant
DavidBruant / filter.js
Created August 23, 2013 07:51
10 out of 10000
(function(){
var a = [];
for(var i = 0 ; i < 10000 ; i++){
a.push({
entryType : Math.random() < 0.001 ? 'resource' : 'mark',
name: 'yo',
startTime : performance.now(),
duration: 0
})