Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am misterburton on github.
  • I am misterburton (https://keybase.io/misterburton) on keybase.
  • I have a public key whose fingerprint is 7A5F BABC B268 7107 B4AE 4934 C2A5 1CC5 E11F A431

To claim this, I am signing this object:

@misterburton
misterburton / tumblr-delete-all-posts.js
Last active July 1, 2025 05:40
How to Delete All Tumblr Posts via JavaScript & the Browser Console
/*
Navitage to your mass post editor:
https://www.tumblr.com/mega-editor/[blog-name]
Open your browser's JavaScript Console and paste either of the following code snippets
*/
// delete 100 tumblr posts at a time (h/t Louis Lee: http://louisrli.github.io/blog/2013/05/11/how-to-delete-all-tumblr-posts/)
javascript:$('.overlay').slice(0, 100).click(); // you must now manually hit the 'delete' button at the top-right of the page
// delete all tumblr posts (h/t Hendry Sadrak [@hendrysadrak] a commenter on Li's above-linked post)
@misterburton
misterburton / gist:2453776ef5dd9dc89e2e37b417c5a021
Created September 26, 2021 18:54
Tezos Profiles GitHub Verification
I am attesting that this GitHub handle misterburton is linked to the Tezos account tz1gTmZ4rSNZ3Zu7m7GbMi9rQVjUs7GyMK7b for tzprofiles
sig:edsigtzsWR6Xgjb5Bpg9QVpJdR77AgdDe8b4jx4XBFXGxcMXzxZZUKQe96g9aQiiWWRXiXRSWTAjSaNSRuxJYg1Mwxs95UqFny6
@misterburton
misterburton / pre-translate.js
Last active January 6, 2026 20:19
AI-Powered Localization - Translation Generation Script
/**
* pre-translate.js
*
* Extracts translatable content from HTML pages and sends it to a translation API.
* Stores results in Vercel KV for fast edge-cached retrieval.
*
* REQUIREMENTS:
* - Node.js 18+
* - npm packages: fs-extra, jsdom, @vercel/kv, dotenv
* - Vercel project with KV database configured
@misterburton
misterburton / generate-narration.js
Created January 5, 2026 22:25
AI-Powered Localization - Audio Narration Generation Script
/**
* generate-narration.js
*
* Generates audio narration for HTML pages using ElevenLabs text-to-speech API.
* Supports multiple languages using multilingual voice models.
*
* REQUIREMENTS:
* - Node.js 18+
* - npm packages: fs-extra, jsdom, @vercel/kv, dotenv
* - ElevenLabs API key (https://elevenlabs.io)
@misterburton
misterburton / speech.js
Created January 5, 2026 22:25
AI-Powered Localization - Client-Side Narration Player
/**
* ArticleSpeech - Client-Side Narration Player
*
* A lightweight audio narration system that plays pre-generated MP3 files
* while highlighting corresponding content on the page. Supports multiple
* languages, keyboard shortcuts, and accessibility features.
*
* REQUIREMENTS:
* - Pre-generated audio files in /audio/{lang}/{page-name}/p0.mp3, p1.mp3, etc.
* - HTML elements with data-narration="0", data-narration="1", etc.
@misterburton
misterburton / localization-manager.js
Created January 5, 2026 22:25
AI-Powered Localization - Client-Side Translation Handler
/**
* LocalizationManager - Client-Side Translation Handler
*
* Manages real-time language switching with translation caching, DOM updates,
* and narration integration. Works with a server-side translation API that
* uses AI (like Gemini Flash) to translate content.
*
* REQUIREMENTS:
* - Server-side /api/translate endpoint (see pre-translate.js gist)
* - HTML elements with data-l10n-id attributes
@misterburton
misterburton / content-manager.js
Created January 5, 2026 22:25
AI-Powered Localization - Dev Workflow Tools
/**
* ContentManager - Development Workflow Tools
*
* A development-only utility that detects content changes and provides
* visual feedback for regenerating translations and audio narration.
* Shows "MODIFIED" badges on changed content and provides copy-to-clipboard
* commands for regeneration scripts.
*
* REQUIREMENTS:
* - content-hashes.json file with stored hashes (generated by pre-translate.js)
@misterburton
misterburton / translate-api.js
Created January 6, 2026 21:33
Vercel API endpoint for AI translation using Gemini Flash + Vercel KV caching
/**
* translate-api.js (Vercel Serverless Function)
*
* A Vercel API endpoint that translates content using Google's Gemini Flash
* and caches results in Vercel KV for fast retrieval.
*
* REQUIREMENTS:
* - Vercel project with KV database configured
* - npm packages: @google/generative-ai, @vercel/kv
* - Environment variables in Vercel dashboard or .env.local: