Skip to content

Instantly share code, notes, and snippets.

View ringtailsoftware's full-sized avatar

Toby Jaffey ringtailsoftware

View GitHub Profile
@ringtailsoftware
ringtailsoftware / ghostty-6pane.sh
Created March 12, 2026 09:36
Setup a ghostty window with 6 panes via AppleScript
#!/bin/bash
osascript -e "
tell application \"Ghostty\"
set bigcfg to new surface configuration
set initial working directory of bigcfg to POSIX path of \"$HOME\"
set font size of bigcfg to 18
set smallcfg to new surface configuration
@ringtailsoftware
ringtailsoftware / clipboard-image-to-data-url.sh
Last active January 4, 2023 22:46
MacOS shell script to convert image in clipboard to HTML img tag containing data URL
#!/bin/bash
# https://codewithhugo.com/convert-image-data-url/
function img-data() {
TYPE=$(file --mime-type -b $1)
ENC=$(base64 $1)
echo -ne '<img src="'"data:$TYPE;base64,$ENC"'"/>'
}
# Convert image data in clipboard to file containing JPEG
# This is a default site configuration which will simply return 404, preventing
# chance access to any other virtualhost.
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; # New root location
@ringtailsoftware
ringtailsoftware / toot.sh
Created November 8, 2022 22:57
Mastodon Toot Shell Script
#!/bin/bash
MASTODON_SERVER=https://mastodon.social
MASTODON_USERNAME=foo@bar.com
MASTODON_PASSWORD=secretpassword
CLIENT_NAME=myclient # anything you like
CLIENT_URL=http://myclient.com # anything you like
APP=`curl -X POST -d "client_name=$CLIENT_NAME&redirect_uris=urn:ietf:wg:oauth:2.0:oob&scopes=write read follow&website=$CLIENT_URL" $MASTODON_SERVER/api/v1/apps`
CLIENT_ID=`echo $APP | jq -r .client_id`
@ringtailsoftware
ringtailsoftware / ProductList.csv
Last active February 5, 2022 23:49
How do I maintain a dynamic list of items with pdfs download links for each and at any given time select multiples items from that list and get a unique .zip of all the pdfs?
rabbit.pdf https://www.robotshop.com/media/files/pdf/quick-start-guide-n029.pdf
t-encabulator.pdf https://www.rfcafe.com/miscellany/humor/ge-turbo-encabulator.pdf