Skip to content

Instantly share code, notes, and snippets.

View tbjgolden's full-sized avatar

Tom Golden tbjgolden

  • Error 401
  • London
  • 07:36 (UTC +01:00)
View GitHub Profile
tbjgolden / eslint.config.mjs
Created April 28, 2024 22:11
eslint config (wip)
import eslintJs from "@eslint/js";
import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
import typescriptEslintParser from "@typescript-eslint/parser";
import disableRulesThatClashWithPrettierConfig from "eslint-config-prettier";
import eslintConfigXo from "eslint-config-xo";
import eslintPluginReact from "eslint-plugin-react";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
tbjgolden / docker-compose.yml
Last active May 24, 2021 15:06
Figure I'll need this again
version: "3.8"
image: "postgres:12"
- "54320:5432"
- ./pgdata:/var/lib/postgresql/data
tbjgolden /
Last active April 26, 2021 18:25
Benchmarks for CSS minifiers 2021 edition
tbjgolden /
Created December 13, 2020 00:40
af-magic for fishes
# extended from martpie/af-magic
# + uses fish built-in abbreviated paths instead of the af-magic one
# + hyphens go full width
# name: L
function _git_branch_name
echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')
function _is_git_dirty
tbjgolden / hard-reset.css
Created October 22, 2020 17:56
Hard Reset CSS
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
caption, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
tbjgolden /
Last active April 6, 2024 07:13
[Arch Linux] [Manjaro] How to avoid "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)

To avoid this error, we need to increase the inotify watcher limit.

The way to do this is different on Arch based distributions than other Linux distributions.

Instructions for Arch Linux/Manjaro

Check for an already existing inotify config file (recent versions of Manjaro include one)

tbjgolden /
Last active May 31, 2020 04:58
How to use optionalDependencies in a Rollup library (with ES and TS examples)

Using csso as the example library I'm making an optional dependency

ES Module example (file.js)

let csso = globalThis && globalThis.csso
if (!csso) {
    .then(_csso => {
      csso = _csso.default
tbjgolden /
Last active December 20, 2023 12:10
Low-effort, high-reward browserlist config to avoid vendor prefix hell

Low-effort, high-reward browserlist config to avoid vendor prefix hell

(Stats used from 2022-06-20)

chrome >= 79, and_chr >= 81, safari >= 13, ios_saf >= 12.4, firefox >= 73

...or more generally

tbjgolden / Queue.ts
Created April 11, 2020 19:46
Fast implementation of a queue in TypeScript/JavaScript
class Queue {
private readonly queue: any[];
private start: number;
private end: number;
constructor(array: any[] = []) {
this.queue = array;
// pointers
this.start = 0;
tbjgolden / css-shorthand-map.json
Created March 21, 2020 16:17
JSON map from CSS shorthand properties to their sub-properties
"animation": [