Skip to content

Instantly share code, notes, and snippets.

View connorjclark's full-sized avatar

Connor Clark connorjclark

View GitHub Profile
@connorjclark
connorjclark / output.txt
Last active October 10, 2024 19:16
chrome devtools locales
NOTE: you should just run the unit.js script in chrome devtools console. The below is running from Node 18.18, which has different ICU data
{ style: 'unit', unit: 'millisecond', unitDisplay: 'narrow' }
┌─────────┬───────────┬─────────────────┐
│ (index) │ locale │ text │
├─────────┼───────────┼─────────────────┤
│ 0 │ 'as' │ '১২৩.৫ মিঃ ছেঃ' │
│ 1 │ 'lo' │ '123,5 ມລ. ວິ.' │
│ 2 │ 'si' │ 'මිලිතත් 123.5' │
@connorjclark
connorjclark / generate_themes.py
Last active July 26, 2024 13:30
Convert vs code themes to monaco themes
import json
import os
import subprocess
from pathlib import Path
import json5
import requests
script_dir = Path(os.path.dirname(os.path.realpath(__file__)))
@connorjclark
connorjclark / prime.wat
Last active August 7, 2024 13:57
prime.wat
(module $ffc-2-Prime
(type $t0 (func (param i32)))
(type $t1 (func (param i32 i32 i32) (result i32)))
(type $t2 (func (param i32) (result i32)))
(type $t3 (func (param i32 i32)))
(type $t4 (func (param i32 i32 i32 i32 i32)))
(type $t5 (func))
(import "env" "memory" (memory $env.memory 1 32768 shared))
(import "env" "set_return_value" (func $env.set_return_value (type $t0)))
(import "env" "do_commands" (func $env.do_commands (type $t1)))
// This is @esbuild-plugins/node-modules-polyfill, but using a better library
// for polyfills. It was done in this PR which has not merged:
// https://github.com/remorses/esbuild-plugins/pull/19
import fs from 'fs';
import path from 'path';
import escapeStringRegexp from 'escape-string-regexp';
import esbuild from 'esbuild';
@connorjclark
connorjclark / main.js
Last active December 5, 2021 23:23
web platform latest stable features script
const browserCompat = require('@mdn/browser-compat-data');
const browsersToConsider = [
'chrome',
'edge',
'firefox',
'safari_ios',
'safari',
];
@connorjclark
connorjclark / script.sh
Created October 29, 2021 17:23
lighthouse chrome bisect cdt-manifest-install-errors-hang
# python bisect-builds.py --verify-range -a mac -g 800000 -b 929940 --use-local-cache --not-interactive -c "bash $PWD/scripts/cdt-manifest-install-errors-hang/script.sh %p"
# result
# https://chromium.googlesource.com/chromium/src/+log/f4571bef8272f8dce9169f8605138d09392fdb74..a4cd0dbf88fe1e055a03f5394fe2cadd1156c7d7
LH=~/src/lighthouse
export CHROME_PATH=$1
# brew install coreutils
@connorjclark
connorjclark / debug.js
Created October 12, 2021 18:42
axe related nodes lh
delete window.define;
(() => {
/*! axe v4.2.3
* Copyright (c) 2021 Deque Systems, Inc.
*
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This entire copyright notice must appear in every copy of this file you
@connorjclark
connorjclark / axe-related-nodes-lhr.json
Created October 7, 2021 23:38
axe-related-nodes-lhr.json
@connorjclark
connorjclark / lighthouse.txt
Last active August 21, 2021 00:12
print size of node_modules for every commit
770868 46d282b83 report(flow): standalone shell report with preact (#12850) 2021-08-18
745328 305540f27 deps: update to [email protected] (#12909) 2021-08-13
741724 52beae3f0 clients(viewer): convert to ES modules (#12878) 2021-08-10
741244 800ffd6da report: autogenerate components.js from templates.html (#12803) 2021-08-09
741120 c30ba2de5 deps(csp-evaluator): upgrade to exactly 1.0.4 (#12858) 2021-08-04
740824 e58aa09a2 deps: update third-party-web to 0.12.4 (#12753) 2021-07-30
740108 d62acc3d6 deps: update lighthouse-logger to 1.3.0 (#12812) 2021-07-21
740112 3aa15dc69 report: convert to ES modules (#12702) 2021-07-15
731968 0af83bfd6 deps: bump axe-core to 4.2.3 (#12706) 2021-06-25
731936 cacf13540 deps: update `ws` to latest (#12638) 2021-06-10