Skip to content

Instantly share code, notes, and snippets.

@shawnyeager
shawnyeager / convert_jekyll_to_prose.py
Created May 4, 2025 02:20
Convert Jekyll-formatted markdown files to prose.sh format.
#!/usr/bin/env python3
"""
Convert Jekyll-formatted markdown files to prose.sh format.
This script transforms Jekyll blog posts to prose.sh format with the following enhancements:
1. Processes all .md files in the current directory
2. Creates a 'prose.sh' subdirectory for output files
3. Transforms front matter:
- Removes Jekyll-specific fields like layout
- Preserves title, date, description (with markdown removed)
@shawnyeager
shawnyeager / convert_drafts_to_obsidian.py
Created April 2, 2025 14:38
Python script to convert Drafts app export in JSON format to a drop-in-ready folder of Obsidian markdown files
import json
import os
import re
import argparse
def sanitize_filename(title):
"""Convert a title into a safe filename by replacing invalid characters, preserving spaces."""
# Replace invalid filesystem characters with spaces
invalid_chars = r'[\/:*?"<>|]'
sanitized = re.sub(invalid_chars, ' ', title.strip())
@shawnyeager
shawnyeager / download-mp4.sh
Last active February 25, 2025 14:03
Download YouTube video and re-encode for playback on web and iOS (requires yt-dlp and ffmpeg)
#!/usr/bin/env bash
# Usage: download-mp4.sh <YouTube_URL>
if [ -z "$1" ]; then
echo "Usage: download-mp4.sh <YouTube_URL>"
exit 1
fi
URL="$1"
@shawnyeager
shawnyeager / ytplay.sh
Last active November 27, 2024 15:18
quick & dirty script to take command line input, search youtube with ytfzf, and play audio with mpv
#!/bin/bash
# Check if a search string is provided as a command-line argument
SEARCH_STRING="$*"
# Function to handle playback
play_content() {
# Use `ytfzf` to fetch the video URL
VIDEO_URL=$(ytfzf -L "$SEARCH_STRING" 2>/dev/null)
@shawnyeager
shawnyeager / user.css
Created October 12, 2024 16:20
Catppuccin Macchiato-flavored `user.css` theme for catapult launcher for Linux
/* Any CSS added here can be used to override theme CSS. */
/* Use ":reload-theme" in Catapult to see changes. */
/* For available classes, see the Catapult default "dark" theme: */
/* https://github.com/otsaloma/catapult/blob/master/data/themes/dark.css */
.catapult-input-entry {
font-family: "Cantarell", sans-serif;
}
.catapult-search-result-title {
@shawnyeager
shawnyeager / protonmail_sieve_bulk.txt
Created July 8, 2021 09:14
Bulk mail sieve filter for ProtonMail
require ["fileinto", "imap4flags", "envelope"];
if address :is :localpart ["from", "all"] [
"do-not-reply",
"do_not_reply",
"donotreply",
"newsletter",
"no-reply",
"noreply",
"notification",

Keybase proof

I hereby claim:

  • I am shawnyeager on github.
  • I am shawnyeager (https://keybase.io/shawnyeager) on keybase.
  • I have a public key whose fingerprint is 1588 4904 ED7A BA05 E51D 9333 9DDC 0A8B A587 E694

To claim this, I am signing this object: