Skip to content

Instantly share code, notes, and snippets.

@maxfenton
maxfenton / verygoods.txt
Last active November 20, 2026 19:03
Very Goods Bookmarklet (2026)
javascript:(function(){var d=document,o='https://verygoods.co',imgs=[].slice.call(d.querySelectorAll('img')).filter(function(i){return i.width>=300&&i.width/i.height<=8}).map(function(i){return{src:i.src,height:i.height,width:i.width}}).sort(function(a,b){return b.width*b.height-a.width*a.height}),p=JSON.stringify(imgs),w=window.open(o+'/bookmarklet/1?title='+encodeURIComponent(d.title)+'&url='+encodeURIComponent(location.href),'verygoods','width=540,height=760');if(!w){alert('Popup blocked');return}window.addEventListener('message',function(m){if(m.origin===o&&m.data==='get-images')m.source.postMessage(p,o)});var n=0,t=setInterval(function(){if(w.closed||++n>20){clearInterval(t);return}try{w.postMessage(p,o)}catch(e){}},500);})();
@maxfenton
maxfenton / pull-content
Created May 7, 2026 14:08
bin/pull-content
#!/usr/bin/env bash
# Pull content from production to local. READ-ONLY — never touches the server.
#
# Usage:
# bin/pull-content — dry run
# bin/pull-content --real — execute
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
@maxfenton
maxfenton / push-accounts-to-staging
Created May 7, 2026 14:07
bin/push-accounts-to-staging
#!/usr/bin/env bash
# Push local Panel accounts to staging.
# Defaults to dry run — shows what would change without touching the server.
#
# Usage:
# bin/push-accounts-to-staging — dry run
# bin/push-accounts-to-staging --real — execute
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
@maxfenton
maxfenton / push-content-to-production
Created May 7, 2026 14:07
bin/push-content-to-production
#!/usr/bin/env bash
# Push local content to production. ONE-TIME use at go-live to seed Kirby 4 content.
# After go-live, content flows the other way (panel edits → bin/pull-content).
# Defaults to dry run.
#
# Usage:
# bin/push-content-to-production — dry run
# bin/push-content-to-production --real — execute
set -euo pipefail
@maxfenton
maxfenton / push-content-to-staging
Created May 7, 2026 14:02
bin/push-content-to-staging
#!/usr/bin/env bash
# Push local content to staging. Defaults to dry run.
#
# Usage:
# bin/push-content-to-staging — dry run
# bin/push-content-to-staging --real — execute
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
@maxfenton
maxfenton / backstop
Created May 7, 2026 14:01
bin/backstop
#!/usr/bin/env bash
# Wrapper around the global `backstop` CLI.
#
# Usage:
# bin/backstop reference # capture from production (default)
# bin/backstop test --env=local # test against local DDEV site
# bin/backstop reference --env=staging
# bin/backstop approve
#
# --env=<local|staging|production> Sets BACKSTOP_ENV, read by backstop.cjs to pick baseUrl.
@maxfenton
maxfenton / branchname.yml
Created October 1, 2025 15:19
Github Actions workflow for deploying a Kirby site to shared hosting with rsync
name: Staging Deployment
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
@maxfenton
maxfenton / postcss.config.js
Created May 1, 2023 19:15
PostCSS config for a legacy SASS project
module.exports = {
parser: "postcss-scss",
plugins: [
require("postcss-easy-import")({ // Enables globs in @import. See style.css.
prefix: false,
skipDuplicates: false,
warnOnEmpty: false,
}),
require("postcss-advanced-variables"), // Sass-style @ vars, looping, and @import
require("postcss-custom-media"), // Custom reusable media queries
@maxfenton
maxfenton / Twig - Craft.xml
Last active May 1, 2023 15:50
PhpStorm live template for CraftCMS / Twig development
<templateSet group="Twig - Craft">
<template name="tag" value="{% tag '$END$' with {} %}&#10;&#9;&#10;{% endtag %}" description="{% tag %}...{% endtag %}" toReformat="false" toShortenFQNames="true">
<context>
<option name="Twig" value="true" />
</context>
</template>
</templateSet>
@maxfenton
maxfenton / uses.md
Last active November 8, 2024 16:46
Uses

/uses

a document about the tools I use to do my work as a web developer

Software

First of all

title type
oh-my-zsh terminal flavor