Skip to content

Instantly share code, notes, and snippets.

View connorjclark's full-sized avatar

Connor Clark connorjclark

View GitHub Profile
@connorjclark
connorjclark / .gitconfig
Last active February 6, 2025 20:38
git aliases
[alias]
# show recent commits
# configure: news-less or news-fzf? see below
news-impl = news-less
# configure: how many days ago do you wanna see?
news = !git news-impl --since '3 days ago'
# configure: make your own alias to scope to folders you care about
rpp = !git news \"$@\" front_end/models/trace front_end/panels/timeline/ front_end/panels/lighthouse/ front_end/ui/legacy/components/perf_ui "#"
@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