Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
swimming

Tom Golden tbjgolden

🌊
swimming
View GitHub Profile
@tbjgolden
tbjgolden / docker-compose.yml
Last active May 24, 2021
Figure I'll need this again
View docker-compose.yml
version: "3.8"
services:
db:
image: "postgres:12"
ports:
- "54320:5432"
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=usrnm
@tbjgolden
tbjgolden / 1_benchmarks.md
Last active Apr 26, 2021
Benchmarks for CSS minifiers 2021 edition
View 1_benchmarks.md
@tbjgolden
tbjgolden / fish_prompt.fish
Created Dec 13, 2020
af-magic for fishes
View fish_prompt.fish
# 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/||')
end
function _is_git_dirty
View 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
tbjgolden / inotify-instructions.md
Last active Sep 11, 2022
[Arch Linux] [Manjaro] How to avoid "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)
View inotify-instructions.md

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
tbjgolden / optionalDependenciesRollup.md
Last active May 31, 2020
How to use optionalDependencies in a Rollup library (with ES and TS examples)
View optionalDependenciesRollup.md

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

ES Module example (file.js)

let csso = globalThis && globalThis.csso
if (!csso) {
  import('csso')
    .then(_csso => {
      csso = _csso.default
@tbjgolden
tbjgolden / progressive-browserlist-config.md
Last active Jun 19, 2022
Low-effort, high-reward browserlist config to avoid vendor prefix hell
View progressive-browserlist-config.md

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
tbjgolden / Queue.ts
Created Apr 11, 2020
Fast implementation of a queue in TypeScript/JavaScript
View Queue.ts
class Queue {
private readonly queue: any[];
private start: number;
private end: number;
constructor(array: any[] = []) {
this.queue = array;
// pointers
this.start = 0;
@tbjgolden
tbjgolden / css-shorthand-map.json
Created Mar 21, 2020
JSON map from CSS shorthand properties to their sub-properties
View css-shorthand-map.json
{
"animation": [
"animation-name",
"animation-duration",
"animation-timing-function",
"animation-delay",
"animation-iteration-count",
"animation-direction",
"animation-fill-mode",
"animation-play-state"
@tbjgolden
tbjgolden / bitwardenTidy.js
Last active Mar 6, 2021
Import bitwarden export json, interactive deduplicate and export bitwarden import json
View bitwardenTidy.js
const fs = require('fs');
const path = require('path');
const inquirer = require('inquirer');
const uuidv4 = require('uuid/v4');
const owasp = require('owasp-password-strength-test');
const words = new Set([...require('wordlist-english')['english/10'], ...require('wordlist-english')['english/20']]);
const thingsIDontDoAnyMore = require("./thingsIDontDoAnyMore.json");
const { items } = require('./bitwarden_export_file.json');