Skip to content

Instantly share code, notes, and snippets.

View abouthalf's full-sized avatar
🎩
indeed

Michael Barrett abouthalf

🎩
indeed
View GitHub Profile
@abouthalf
abouthalf / uppy.js
Created December 9, 2024 18:54
Quick Script for uploading files to Cloudflare Image Storage (and formatting the results as markdown and JSON) NOT for giant sets of files.
import "dotenv/config";
import { program } from "commander";
import { globbySync } from "globby";
import fs from "fs/promises";
import { basename, extname } from "path";
import mimext from "mimext";
async function main() {
program
.version("0.0.1")
@abouthalf
abouthalf / .prettierrc
Last active October 11, 2023 15:01
Prettier config
{
"trailingComma": "all",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid"
}
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=
@abouthalf
abouthalf / gist:9547a0b10e537519dee031661b51b81c
Created December 7, 2017 18:11
Quick graph of current git branch in relation to other branches
git log --graph --decorate
@abouthalf
abouthalf / Single Pixel Data Uri
Last active October 15, 2021 13:11
A Data URI for a single (black) pixel PNG - Useful for testing JavaScript Image() load events without mocking.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAABNJREFUCB1jZGBg+A/EDEwgAgQADigBA//q6GsAAAAASUVORK5CYII%3D
@abouthalf
abouthalf / settings.json
Last active September 11, 2021 17:19
Visual Studio Code user settings for Operator Mono
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Operator Mono SSm",
// Enables font ligatures
"editor.fontLigatures": true,
// Controls whether the editor should render whitespace characters
"editor.renderWhitespace": "all"
}
@abouthalf
abouthalf / post-receive
Created December 21, 2015 21:30
Example Git post-receive hook which checks out a repository into another directory. Used for deploying a static site to your server (assuming your web-host has git enabled)
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
# Checkout changes from your static site into your web directory
GIT_WORK_TREE=/path/to/your/web/directory git checkout -f ;
fi
done