Skip to content

Instantly share code, notes, and snippets.

View jridgewell's full-sized avatar
😬

Justin Ridgewell jridgewell

😬
  • New York, NY
  • 22:12 (UTC -05:00)
View GitHub Profile
@jridgewell
jridgewell / index.html
Created February 2, 2021 09:29
createElement vs createElementNS (https://jsbench.github.io/#f582e3f3a8cf8d94f9b64f2c65146fe4) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>createElement vs createElementNS</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>
@jridgewell
jridgewell / index.html
Created November 1, 2020 09:15
createElement vs createElementNS (https://jsbench.github.io/#9adaab1aa39df377a8fa9bd067cddb98) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>createElement vs createElementNS</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>
@jridgewell
jridgewell / sort-imports.js
Last active October 30, 2020 03:13
Sort imports by source location, prioritizing external, sibling, then parents
module.exports = {
create(context) {
const imports = [];
const source = context.getSourceCode();
function sorter(a, b) {
const l = Math.max(a.length, b.length);
for (let i = 0; i < l; i += 1) {
if (a[i] === '.' && b[i] !== '.' && b[i] !== '..') return +1;
if (b[i] === '.' && a[i] !== '.' && a[i] !== '..') return -1;
@jridgewell
jridgewell / index.html
Last active October 23, 2020 20:02
Does deleting __proto__ hurt perf? (Run twice to work) (https://jsbench.github.io/#82502a933953f589e1c23ce5af88f6e4) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Does deleting __proto__ hurt perf? (Run twice to work)</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>
@jridgewell
jridgewell / index.html
Created October 15, 2020 20:11
Object.create vs __proto__ syntax for null prototype #jsbench #jsperf (https://jsbench.github.io/#d3ff614bded8bf46cf91df5b898faba1) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Object.create vs __proto__ syntax for null prototype #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>
@jridgewell
jridgewell / readme.md
Last active October 15, 2020 02:11
Uber pushing political ads

Uber is pushing scummy political ads via push notifications to support California Prop 22.

MADD: Prop 22 will save lives
MADD says yes on Prop 22. Will you? (This ad is paid for by Uber Technologies, Inc.)

@jridgewell
jridgewell / index.html
Last active October 7, 2020 09:01
Is sourcemap mappings sorted? (https://jsbench.github.io/#b5130ae558bbca6b002025aca004201e) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Is sourcemap mappings sorted?</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>
@jridgewell
jridgewell / index.html
Last active August 5, 2020 21:39
Adopted vs legacy stylesheets (https://jsbench.github.io/#0bd7efc7c75ef828464d8428c3535a67) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Adopted vs legacy stylesheets</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>Inline vs hoisted regex</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>localName vs tagName</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>