Skip to content

Instantly share code, notes, and snippets.

View andyford's full-sized avatar

Andy Ford andyford

View GitHub Profile
@andyford
andyford / dePlussedEmail.js
Created September 22, 2020 18:14
Remove plus sign and subsequent characters from an email address
// so `[email protected]` becomes `[email protected]`
const dePlussedEmail = (email) => email.split('@')[0].split('+')[0] + '@' + email.split('@')[1];
@andyford
andyford / find-and-delete-node-modules.sh
Last active January 18, 2021 08:22
find and delete all node_modules directories
# see: https://trilon.io/blog/how-to-delete-all-nodemodules-recursively
# you probably don't want to run this against your ENTIRE system
# your user directory might be more appropriate
# cd ~
# finds all node_module directories and prints their path and size
# find . -name "node_modules" -type d -prune -print | xargs du -chs
# finds and recursively deletes all node_module directories
@andyford
andyford / git-diff-ignore.sh
Created February 13, 2023 12:30
git diff exclude
# ignore package-lock.json file
git diff -- ':!package-lock.json'
:root {
--xgrid-max-width: 1072px !important;
--xgrid-max-width-no-edge: 1040px !important;
--xgrid-edge-width: 16px;
--z-header-container-width: var(--xgrid-max-width);
}
@media (min-width: 600px) {
:root {
--xgrid-max-width: 1094px !important;
*[class*=z-][data-zta]:not(.z-anchor, .z-p1, .z-p2, .z-p3) {
outline: 3px double blue !important;
box-shadow: 0 0 1px 4px lime !important;
}
*[class*=z-][data-zta]:not(.z-anchor, .z-p1, .z-p2, .z-p3):hover {
outline: 3px double blue !important;
box-shadow: 0 0 1px 4px lime !important;
background: #eff !important;
}
.z-layout-container {
--z-layout-container-gutter-width: 16px;
--z-layout-container-max-width: 551px;
--z-layout-container-max-width-no-gutter: calc(var(--z-layout-container-max-width) - (var(--z-layout-container-gutter-width) * 2));
max-width: var(--z-layout-container-max-width);
margin-inline: auto;
padding-inline: var(--z-layout-container-gutter-width);
@media (min-width: 600px) {
:root {
--xgrid-max-width: 496px !important;
--xgrid-max-width-no-edge: 1024px !important;
--xgrid-edge-width: 16px;
--z-header-container-width: var(--xgrid-max-width);
[class*=z-brand-theme-bitiba] {
--z-header-container-width: var(--xgrid-max-width);
}
}
@andyford
andyford / macos-disable-automatic-launcher.sh
Last active July 18, 2025 13:48
MacOS: Disable automatic launching of apps. Especially Music.app whenever anything happens with headphones
launchctl bootout gui/$(id -u) /System/Library/LaunchAgents/com.apple.rcd.plist
# restore
# launchctl bootstrap gui/$(id -u) /System/Library/LaunchAgents/com.apple.rcd.plist