Skip to content

Instantly share code, notes, and snippets.

@julienw
julienw / timerj-review.md
Created November 28, 2012 14:58
code review de timerjs

j'ai juste regardé l'API pour l'instant, j'ai quelques remarques déjà là-dessus, je regarderai le code plus tard.

  • l'argument à play est pas clair. Je pense que tu peux faire une configuration fluide du style :
timer.speed(2).play();
ou même
timer.play().speed(2);
ou
timer.speed(2);
timer.play();
@julienw
julienw / always-enable-adb.patch
Created August 19, 2013 07:04
always enable adb - mozcentral 20130819
# HG changeset patch
# User Julien Wajsberg <[email protected]>
# Date 1376895042 -7200
# Node ID c223266e0b08f26268cc2158ba2971982bb67688
# Parent 8c1153bb921922d0eac533953f48b31189601c91
[mq]: force-adb
diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
Promise.prototype.finally = function(callback) {
return this.then(
function(arg) {
function returnArg() { return arg; }
return Promise.resolve(arg).then(callback).then(returnArg, returnArg);
},
function(arg) {
function throwArg() { throw arg; }
return Promise.resolve(arg).then(callback).then(throwArg, throwArg);
}
@julienw
julienw / iframe-height.js
Last active August 29, 2015 14:26
set iframe height
function setIframeHeight() {
window.removeEventListener('load', setIframeHeight); // good citizen
if (window.frameElement) {
window.frameElement.height = document.documentElement.scrollHeight;
}
}
if (document.readyState === 'complete') {
setIframeHeight();
} else {
@julienw
julienw / value.rs
Created February 23, 2016 08:02
Interface factory
use value_classes::value_id::{ ValueType, ValueID };
trait Value<T> {
fn get() -> Result<T, ()>;
fn set(value: T) -> Result<(), ()>;
}
struct ValueBool {
value_id: ValueID
}
Symbolic links:
file1.js -> /home/julien/directory1/file1.js
file2.js -> /home/julien/directory2/file2.js
#!/bin/sh
rm -rf real linked
mkdir -p real/subdir linked
ln -s ../real linked/
cat - > real/subdir/file1.js <<-'EOF'
function() {
EOF
cat - > real/file2.js <<-'EOF'
@julienw
julienw / mixer
Last active February 27, 2017 15:10
mixer
Init:
A and A' are the same person:
A B C D E
A' B' C' D' E'
Round 1:
A B C D E
B' C' D' E' A'
This file has been truncated, but you can view the full file.
{"address": [
-1,
2980,
3975,
65637314,
-1,
65636316,
65634407,
64976601,
40044106,