Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / .gitignore
Last active April 11, 2022 21:33
Svelte hello world
node_modules
bundle.js
@nolanlawson
nolanlawson / index.ts
Created July 24, 2021 18:47
Basic emoji-picker-element typescript example
import { Picker } from 'emoji-picker-element'
const picker = new Picker()
document.body.appendChild(picker)
@nolanlawson
nolanlawson / .gitignore
Last active July 6, 2021 15:29
Repro Svelte preprocess sourcemap
bundle.js
bundle.js.map
node_modules
@nolanlawson
nolanlawson / .gitignore
Last active July 2, 2021 21:57
Repro tachometer dependency issue
node_modules
@nolanlawson
nolanlawson / .gitignore
Last active June 28, 2021 02:50
Svelte Rollup repro
node_modules
bundle.js
@nolanlawson
nolanlawson / index.html
Created June 21, 2021 18:15
event.path
<!doctype html>
<html>
<head>
<title>event.path</title>
</head>
<body>
<h1>event.path</h1>
<button type=button>Click me</button>
<script>
document.querySelector('button').addEventListener('click', e => console.log(e.path))
@nolanlawson
nolanlawson / index.html
Last active May 29, 2021 20:24
Embed codepen that uses canvas
<!doctype html>
<html>
<body>
<h1>Embed codepen that uses canvas </h1>
<p>Click "Result":</p>
<iframe src="https://codepen.io/anon/embed/MWpOarg?height=450&theme-id=1&slug-hash=LYxKJzd&default-tab=js,result"></iframe>
</body>
</html>
@nolanlawson
nolanlawson / index.html
Created May 29, 2021 20:14
Test canvas
<!doctype html>
<html>
<body>
<div></div>
<script>
const FONT_FAMILY = '"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif';
const getTextFeature = (text2, color) => {
try {
const canvas = document.createElement("canvas");
canvas.width = canvas.height = 1;
@nolanlawson
nolanlawson / index.html
Created May 20, 2021 18:58
Console leak repro
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Console leak repro</title>
</head>
<body>
<h1>Console leak repro</h1>
<button type="button" onclick="causeFakeLeak()">Cause a "leak"</button>
<script>
@nolanlawson
nolanlawson / index.html
Created May 13, 2021 14:47
Focus visible keyboard shortcuts repro
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Focus visible keyboard shortcuts repro</title>
<style>
*, *:after, *:before {
box-sizing: border-box;
}
:focus:not(:focus-visible) {