Skip to content

Instantly share code, notes, and snippets.

@brandonsheppard
brandonsheppard / os-dark
Last active May 17, 2026 16:41
Ghostty config
# Typeface
font-family = FiraCode Nerd Font Mono
font-style = Retina
font-feature = calt
font-size = 16
adjust-cell-height = 18%
# Colors
theme = light:/Users/brandonsheppard/Library/Application Support/com.mitchellh.ghostty/themes/os-light,dark:/Users/brandonsheppard/Library/Application Support/com.mitchellh.ghostty/themes/os-dark
background-opacity = 0.9
@brandonsheppard
brandonsheppard / script.sh
Created February 3, 2026 05:33
One command to setup openclaw on a new mac
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && brew update && brew install node && curl -fsSL https://openclaw.ai/install.sh | bash && openclaw onboard --install-daemon
@brandonsheppard
brandonsheppard / worker.js
Created May 31, 2020 00:14
Redirect to naked domain — Cloudflare Worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const pageURL = new URL(request.url);
return Response.redirect(`${pageURL.protocol}//${String(pageURL.host).substring(4)}${pageURL.pathname}${pageURL.search}`)
}
@brandonsheppard
brandonsheppard / how.md
Created September 5, 2019 23:11
Sum and search by content and date (parsed) in Google visual query language
=iferror(sum(query(Transactions!$A:$F,"select D where B contains '"&$A11&"' and A = date '"&text(F$1,"yyyy-mm-dd")&"'")))
@brandonsheppard
brandonsheppard / gist:89476f18fbb6a3f4c6ed0190e2e28395
Created March 18, 2019 06:34
Find all cached sub-pages in web.archive.org
https://web.archive.org/web/*/URL/*

e.g.,

https://web.archive.org/web/*/https://github.com/NetoECommerce/Skeletal/*
@brandonsheppard
brandonsheppard / gist:8e9b40a4be8462e0c68452adc4835404
Created November 12, 2018 21:04
Conditional format — highlight last month
=date(year(edate(today(),-1)),MONTH(edate(today(),-1)),1)
// assumes date in cell is the 1st
@brandonsheppard
brandonsheppard / how.md
Last active December 28, 2017 04:55
Format release notes MD from JSON.

formatNotes()

Pass commit data into this function to format a markdown commit note. Data structure is based on what Github's compare endpoint returns.

This is useful for generating a changelog for release notes based on git activity.

Example data:

Based on response from Github's compareCommits endpoint.

@brandonsheppard
brandonsheppard / how.md
Created December 28, 2017 04:51
Generate chronological version number based on previous version number

generateVersionNumber()

This function generates a date-based version number. Year + Month + Iteration

So, the first release in March 2017 will be 17.3.0

If multiple releases occur in a month, the final number will increase. Otherwise, an entirely new verion number will be generated.

i.e.

@brandonsheppard
brandonsheppard / demo.js
Last active November 23, 2017 23:46
Simple form event logging with Performance Web API and jQuery
// Run on page load
$('input').on('focus blur',function(e){
performance.mark(e.type+ ' ' + e.target.name)
});
// Run to see results
console.table(performance.getEntriesByType('mark'))
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation.type);
});
});
observer.observe(document.getElementById('bill_selector'), {
attributes: true,
childList: true,
characterData: true