Skip to content

Instantly share code, notes, and snippets.

View andyford's full-sized avatar

Andy Ford andyford

View GitHub Profile
: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);
[class*=z-brand-theme-bitiba] {
--z-header-container-width: var(--xgrid-max-width);
}
}
.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) {
*[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;
}
: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;
@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'
@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 / dePlussedEmail.js
Created September 22, 2020 18:14
Remove plus sign and subsequent characters from an email address
// so `user+stuff@example.com` becomes `user@example.com`
const dePlussedEmail = (email) => email.split('@')[0].split('+')[0] + '@' + email.split('@')[1];
@andyford
andyford / base64-spacer-gif.html
Last active November 23, 2021 15:24
base64 spacer gif
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" />
@andyford
andyford / collapse-whitespace-and-newlines.js
Last active September 18, 2020 19:48
collapse whitespace and newlines
// use with CSS rule: 'white-space: pre-wrap;'
const collapsedString = originalString
// remove leading and trailing whitespace
.trim()
// remove spaces before/after newlines - https://stackoverflow.com/a/5568828 (in comment by ridgerunner)
.replace(/^[^\S\r\n]+|[^\S\r\n]+$/gm, "")
// collapse all spaces down to one space - https://stackoverflow.com/a/1981366
.replace(/ +/g, " ")
// collapse 3+ newlines down to 2 newlines (preserving paragraphs) - https://stackoverflow.com/a/10965543
// a js/node sleep/delay because I always forget how
// credit: https://stackoverflow.com/a/49139664/17252
await new Promise(resolve => setTimeout(resolve, 2000));