Skip to content

Instantly share code, notes, and snippets.

@kyranjamie
kyranjamie / migrate-labels-no-spaces.js
Created March 12, 2024 12:14
Script to remove all spaces from Github labels
// Super hacky script to paste into dev tools to remove spaces from github labels
[...document.querySelectorAll(".js-label-list > div")].forEach(async (el, i) => {
await new Promise((resolve) => setTimeout(resolve, 400 * i));
const edit = el.querySelector(".js-edit-label");
edit?.click();
const label = el.querySelector('[placeholder="Label name"]');
const value = label?.getAttribute("value");
const newValue = value?.replaceAll(' ', '')
console.log(newValue)
label?.setAttribute("value", newValue);
@kyranjamie
kyranjamie / countries.enum.ts
Last active April 28, 2024 09:30
TypeScript enum Country Codes ISO 3166
export enum Country {
Afghanistan = 'AF',
AlandIslands = 'AX',
Albania = 'AL',
Algeria = 'DZ',
AmericanSamoa = 'AS',
Andorra = 'AD',
Angola = 'AO',
Anguilla = 'AI',
Antarctica = 'AQ',