Skip to content

Instantly share code, notes, and snippets.

@fflorent
fflorent / t2.js
Last active November 1, 2017 17:57
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
const page = await browser.newPage();
await page.goto('https://dofusama.fr/treasurehunt/stats/tous-les-indices.html')
const href = await page.evaluate(async () => {
const link = document.querySelectorAll('table a')[0]
return Promise.resolve(link.href);
})
@fflorent
fflorent / gist:4418708
Last active December 10, 2015 10:08 — forked from anonymous/gist:4418578
function loop(f)
{
for(var i = 0; i < 10000; i++)
f(Math.floor(Math.random() * 2 - 1));
}
console.time(">-1");
loop(function(index) index * eval("1") > -1);
console.timeEnd(">-1");