Skip to content

Instantly share code, notes, and snippets.

@milahu
milahu / skibadee.js
Created January 19, 2020 17:15
show all additions in wikipedia page history
// show all additions in wikipedia page history
//
// get the XML file from
// https://en.wikipedia.org/wiki/Special:Export
//
// Add pages manually:
// Skibadee
//
// [ ] Include only the current revision, not the full history
// ^ uncheck this
@milahu
milahu / index.html
Last active October 5, 2020 15:58
performance of different loop types #jsbench #jsperf (http://jsbench.github.io/#6f65c587af9277325bcda0e69ba44d5f) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>performance of different loop types #jsbench #jsperf</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>
@milahu
milahu / index.html
Last active October 5, 2020 16:30
test if array index exists by value or array length #jsbench #jsperf (http://jsbench.github.io/#8d011d47ee4a1cfda2e94b07ca28d351) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>test if array index exists by value or array length #jsbench #jsperf</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>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>unswitch for loop</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>
@milahu
milahu / index.html
Last active October 7, 2020 06:37
test if type is string (http://jsbench.github.io/#9ea2f56bba30fed35f1b5f2b22954d4e) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>test if type is string</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>
@milahu
milahu / index.html
Last active October 10, 2020 08:23
binary search vs biased binary search (optimized for sequential search) #jsbench #jsperf (http://jsbench.github.io/#24ecbbbc5d760eb771f776b227d8c36b) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>binary search vs biased binary search (optimized for sequential search) #jsbench #jsperf</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>
@milahu
milahu / sveltePreval.js
Last active November 22, 2020 12:17
preval for svelte
// moved to https://github.com/milahu/svelte-preval
/*
preval for svelte
code is at line 250 :P
performant:
eval static expressions at compile time
@milahu
milahu / index.html
Created December 17, 2020 18:08
native sort vs JS sort (https://jsbench.github.io/#c90f8f13202ce5498f811ff79fb281ed) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>native sort vs JS sort</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>
@milahu
milahu / index.html
Last active December 18, 2020 15:24
unswitch for loop #jsbench #jsperf (https://jsbench.github.io/#ad362c5589fab6e17498939f5343310d) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>unswitch for loop #jsbench #jsperf</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>
@milahu
milahu / index.html
Last active January 5, 2021 00:17
count number of lines in string (http://jsbench.github.io/#4cc806b4507ae063efc81900cdfb9b02) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>count number of lines in string</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>