This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>.map().join() vs .reduce()</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>.map().join() vs .reduce()</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var form = new FormData() | |
var unique = crypto.getRandomValues(new Int32Array(3)).join('-') | |
form.set('modulenter[titel]', 'db-entry 5') | |
form.set('modulenter[url]', `http://${unique}.com`) | |
form.set('modulenter[name]', 'dba') | |
form.set('modulenter[email]', '[email protected]') | |
form.set('email', 'ZmxhYQD3BQtfYwD4ZvjlYwLkYQZ4YwDfZGRkYvjmBQD2') | |
form.set('mode', 'addlink') | |
form.set('modulenter[text]', JSON.stringify({ | |
nick: "scriptype", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('/list.htm') | |
.then(response => response.text()) | |
.then(html => { | |
var dom = document.createElement('div') | |
dom.innerHTML = html | |
var content = dom.querySelector('#content') | |
var table = content.querySelector('table tbody') | |
var list = Array.from(table.querySelectorAll('tr')).slice(1) | |
var entries = list.map(entry => { | |
var cell = entry.querySelector('td:nth-child(2)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onbeforeunload = e => { | |
postList(url, { | |
nick: "onbeforeunload yes", | |
message: "success ok " + Date.now() | |
}).then(() => { | |
console.log('posted √') | |
}).catch(e => { | |
console.log('couldnt post', e) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>dynamic property assignment new vs old way</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function create(callback) { | |
setTimeout(function() { | |
callback('created') | |
}, Math.random() * 1000) | |
} | |
function read(value, callback) { | |
setTimeout(function() { | |
callback(value + ', red') | |
}, Math.random() * 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="game"> | |
<h1 class="game__title">Satisfy the inputs</h1> | |
<div class="game__screen" id="game-screen"></div> | |
<div class="game__hud"> | |
<div class="game__lives" id="game-lives"></div> | |
<div class="game__score" id="game-score"></div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function useof { | |
if [[ -n $1 ]] | |
then | |
if [[ -n $2 ]] | |
then | |
local dir=$2; | |
else | |
local dir="."; | |
fi | |
grep --recursive --include="*.js" $1 $dir | awk '{ print $1 }' | cut -d':' -f1 | uniq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Needs useof.sh to work (https://gist.github.com/scriptype/96c2cb131ddfc9080128a52d5e633c58) | |
function importof { | |
if [[ -n $1 ]] | |
then | |
if [[ -n $2 ]] | |
then | |
local dir=$2; | |
else | |
local dir="."; |