Skip to content

Instantly share code, notes, and snippets.

View dqh-au's full-sized avatar

dqh-au

View GitHub Profile
@dqh-au
dqh-au / shorten_css_variable_names.js
Last active December 15, 2022 07:05
Shorten CSS variable names using CSSTree
function shortenCssVariableNames(cssAst, digitSymbols, namesToPreserve = [])
{
//
// First figure out how often each variable name is used,
// as we want the shortest replacement names to go to those
// used the most.
//
const nameUsage = {};
@dqh-au
dqh-au / opendiff-git.sh
Created November 10, 2022 03:14
Better macOS git difftool + FileMerge integration
#!/bin/bash
#
# Copyright 2022 David Hogan <david.q.hogan@gmail.com>
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.