Skip to content

Instantly share code, notes, and snippets.

View mitcdh's full-sized avatar

Mitchell Hewes mitcdh

View GitHub Profile
@mitcdh
mitcdh / flickr-deleter.py
Created March 28, 2025 10:17
Script to delete photos from a specific camera before a specific date (reprocessed raws)
import flickrapi
import json
import time
import os
from datetime import datetime
# Get API credentials from environment variables
API_KEY = os.environ.get('FLICKR_API_KEY')
API_SECRET = os.environ.get('FLICKR_API_SECRET')
@mitcdh
mitcdh / paste-into-console.js
Last active February 2, 2025 14:36
Paginated and rate limit aware Trakt collection clearer
const RATE_LIMIT_DELAY = 2000; // Delay between each item collection (2 seconds)
const PAGE_CHANGE_DELAY = 5000; // Delay before changing page (5 seconds)
async function clearTraktCollection() {
// Collect current page
const items = $(".grid-item");
console.log(`Processing ${items.length} items on current page`);
// Process items one by one with delay
for (let i = 0; i < items.length; i++) {
@mitcdh
mitcdh / gist:1c8f840046c03b7cbdc5acc3c7d1530c
Last active January 30, 2025 11:29
Audio Transcription System Prompt
Audio Summary Generator. Return valid JSON only. Process transcript content. Omit empty keys. Use names if identified. Follow schema exactly:
{
"transcript": {
"type": "object",
"required": ["title", "summary", "sentiment"],
"properties": {
"title": {"type": "string", "desc": "Main topic title"},
"summary": {"type": "string", "desc": "Max 10-15% of transcript length"},
"main_points": {"type": "array", "items": {"type": "string", "desc": "Key takeaways (≤5, 100w each, ul)"}},
"action_items": {"type": "array", "items": {"type": "string", "desc": "Mentioned tasks as: 'ISO8601_due_date Task_detailed_description'"}},
@mitcdh
mitcdh / ses-simulators.csv
Created January 27, 2025 16:24
Amazon SES Simulators in Listmonk CSV
email name attributes
[email protected] Success Simulator {"description": "Simulates successful email delivery"}
[email protected] Bounce Simulator {"description": "Simulates a hard bounce scenario"}
[email protected] Out-of-Office Simulator {"description": "Simulates an out-of-office auto-reply (soft bounce)"}
[email protected] Complaint Simulator {"description": "Simulates a recipient complaint"}
[email protected] Suppression List Simulator {"description": "Simulates an address on the suppression list"}
@mitcdh
mitcdh / gist:b5f6388781eec028272fcfbdba6ce0b4
Created January 11, 2025 08:42
Calibre Save Template
{author_sort:uppercase():.1}/{author_sort}/{title}
@mitcdh
mitcdh / flickr-album-inverse-filter.py
Created August 13, 2024 15:43
Filter flickr photos not in a particular album
import flickrapi
import time
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Get environment variables
api_key = os.environ.get("FLICKR_API_KEY")
@mitcdh
mitcdh / vimium-custom-key-mappings
Created January 15, 2024 11:05
Miryoku Vimium mappings
# Miryoku shifted home row hjkl
map j scrollLeft
map k scrollDown
map l scrollUp
map ' scrollRight
@mitcdh
mitcdh / _redirects
Last active March 5, 2025 17:11
Snippets for a post on creating a custom landing page using Cloudflare Pages
/feed/ https://blog.mitcdh.au/index.xml 301
/feed https://blog.mitcdh.au/index.xml 301
/rss/ https://blog.mitcdh.au/index.xml 301
/rss https://blog.mitcdh.au/index.xml 301
/blog/* https://blog.mitcdh.au/:splat 301
@mitcdh
mitcdh / _gist-override.scss
Last active January 13, 2024 08:54
A better dark mode/gist embed for Atega Hugo theme based on Atom One Dark/Light
body .gist-file {
border-color: var(--syntax-highlighting-background) !important;
.gist-data {
background-color: var(--syntax-highlighting-background) !important;
border-bottom: none;
table,
tr,
td {
@mitcdh
mitcdh / example-output.html
Last active January 12, 2024 20:32
Autogeneration of Flickr galleries in hugo
<div class="photo-box">
<a href="https://www.flickr.com/photos/83515912@N03/53444202842" target="_blank">
<img src="https://c1.staticflickr.com/66/65535/53444202842_2286302d06_b.jpg" alt="R0000560" loading="lazy">
</a>
<a href="https://www.flickr.com/photos/83515912@N03/53444202807" target="_blank">
<img src="https://c1.staticflickr.com/66/65535/53444202807_4f2452d4f7_b.jpg" alt="R0000561" loading="lazy">
</a>
<a href="https://www.flickr.com/photos/83515912@N03/53444202782" target="_blank">
<img src="https://c1.staticflickr.com/66/65535/53444202782_41f0b5171f_b.jpg" alt="R0000568" loading="lazy">
</a>