Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / index.ts
Created Jul 24, 2021
Basic emoji-picker-element typescript example
View index.ts
import { Picker } from 'emoji-picker-element'
const picker = new Picker()
document.body.appendChild(picker)
@nolanlawson
nolanlawson / .gitignore
Last active Jul 6, 2021
Repro Svelte preprocess sourcemap
View .gitignore
bundle.js
bundle.js.map
node_modules
@nolanlawson
nolanlawson / .gitignore
Last active Jul 2, 2021
Repro tachometer dependency issue
View .gitignore
node_modules
@nolanlawson
nolanlawson / .gitignore
Last active Jun 28, 2021
Svelte Rollup repro
View .gitignore
node_modules
bundle.js
View index.html
<!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
Embed codepen that uses canvas
View index.html
<!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>
View index.html
<!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
Console leak repro
View index.html
<!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
Focus visible keyboard shortcuts repro
View index.html
<!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) {
@nolanlawson
nolanlawson / index.html
Last active May 12, 2021
Ranges issue repro
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ranges issue repro</title>
</head>
<body>
<h1>Ranges issue repro</h1>
<label>
Click and then type here: