Skip to content

Instantly share code, notes, and snippets.

@heyalexej
Created July 23, 2015 10:36
Show Gist options
  • Save heyalexej/e27d77e1ec5aa9315365 to your computer and use it in GitHub Desktop.
Save heyalexej/e27d77e1ec5aa9315365 to your computer and use it in GitHub Desktop.
// var s = document.createElement('script');
// s.type = 'text/javascript';
// // s.async = true;
// if (my fancy sampling condition) {
// js.src = "//remote-domain.com/script-1.js";
// } else {
// js.src = "//remote-domain.com/script-2.js";
// }
// document.head.appendChild(s);
function lol() {
var random = Math.random();
if (random < 0.01) {
console.log('zeige das 10% der leute');
} else {
console.log('zeige das dem rest');
}
}
var i = 0;
while (i < 10000) {
// okay, lass 10K runden rattern
lol();
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment