Skip to content

Instantly share code, notes, and snippets.

View z1lc's full-sized avatar
🗃️
reviewing flashcards

Rob Sanek z1lc

🗃️
reviewing flashcards
View GitHub Profile
@z1lc
z1lc / math_academy_copy_latex.js
Created December 1, 2025 11:49
Bookmarklet to insert buttons on MathAcademy pages to copy LaTeX code
javascript:(function(){const s=document.querySelectorAll('svg');let c=0;s.forEach(e=>{if(e.parentNode.querySelector('.cp-tex-btn'))return;let t="";const ti=e.querySelector('title');const an=e.querySelector('annotation[encoding="application/x-tex"]');if(ti)t=ti.textContent;if(an)t=an.textContent;if(!t||t.trim().length===0)return;t=t.trim();const b=document.createElement('span');b.innerText='[TeX]';b.className='cp-tex-btn';Object.assign(b.style,{fontSize:'0.75em',color:'#007bff',cursor:'pointer',marginLeft:'5px',verticalAlign:'super',fontFamily:'sans-serif',fontWeight:'bold',zIndex:'1000',position:'relative'});b.onclick=(ev)=>{ev.preventDefault();ev.stopPropagation();navigator.clipboard.writeText(t).then(()=>{const o=b.innerText;b.innerText='[Copied!]';setTimeout(()=>b.innerText=o,1200);});};e.parentNode.appendChild(b);c++;});if(c>0){console.log(`Added copy buttons to ${c} formulas.`);}else{alert('No standard MathJax SVG formulas found.');}})();
@z1lc
z1lc / cloze creator.html
Created August 20, 2025 21:04
easily create a set of Cloze deletions from a newline-seperated list
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anki Cloze Deletion Helper</title>
<!-- Tailwind CSS for styling -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts for a clean, modern look -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
@z1lc
z1lc / gemini-infographic-prompt.md
Created August 9, 2025 17:47
The prompt to generate an infographic using Gemini's Deep Research

Act as an expert frontend developer, data analyst, and UI/UX designer specializing in data visualization. Your task is to generate a complete, single HTML file for a single-page application (SPA) infographic.

Objective: The SPA infographic must effectively present complex data based on the provided source material (e.g., a report, a dataset, or a detailed brief). This includes displaying numerous data points, statistics, forecasts, comparisons, and potentially process flows or relationships within the chosen subject. The goal is easy digestion and understanding for the user within a single, scrollable page, presented through a compelling narrative using the most appropriate visualizations. Your response and SPA infographic should adopt the tone and terminology appropriate for the provided source material's subject matter and intended audience.

Content Focus: The infographic will visualize the key data and concepts from the provided source material. The specific content will depend en

import os
import re
from datetime import datetime, timedelta
from typing import Optional, List
import pytz
import requests
import sendgrid
from bs4 import BeautifulSoup
import json
for i in range(1, 100):
toPrint = ""
if i % 3 == 0:
toPrint += "Crackle"
if i % 5 == 0:
toPrint += "Pop"
if toPrint == "":
toPrint += str(i)
print(toPrint)
@z1lc
z1lc / genanki_testing.py
Created April 27, 2020 02:31
Genanki compatibility testing
import genanki
# models/notes based on genanki README
templates = [
{
'name': 'Card 1',
'qfmt': '{{Question}}',
'afmt': '{{FrontSide}}<hr id="answer">{{Answer}}',
@z1lc
z1lc / autodq.py
Created September 1, 2019 17:31
Automatically run Anki Data Quality checks & display results in main window
import re
from aqt import mw
from aqt.deckbrowser import DeckBrowser
from aqt.qt import *
import aqt.forms
from aqt.utils import showInfo
PREFIX = 'zAQ:'
@z1lc
z1lc / clozetablemanager.py
Last active August 2, 2019 03:40
Anki Add-on: allow cards in the Cloze Tables subdeck to not bury siblings
import random
from datetime import date, timedelta
from aqt import mw
from aqt.qt import *
from anki.hooks import addHook
from anki.utils import intTime
#card.queue: 0=new, -1=suspended
@z1lc
z1lc / force using correct shift.ahk
Created January 19, 2019 05:55
AutoHotkey script to force usage of the correct shift key
<+q::SoundPlay *-1
<+w::SoundPlay *-1
<+e::SoundPlay *-1
<+r::SoundPlay *-1
<+t::SoundPlay *-1
<+a::SoundPlay *-1
<+s::SoundPlay *-1
<+d::SoundPlay *-1
<+f::SoundPlay *-1
<+g::SoundPlay *-1
@z1lc
z1lc / anki_new_card_setter.py
Last active January 19, 2019 04:04
Anki Add-on: Set the number of new cards due in a specified deck based on how much time total you want to spend in review
import math
from aqt import mw
from aqt.qt import *
DECK_EXACT_NAME = "z"
TOTAL_MINUTES = 50
# TODO: I can get this stuff from existing information in DB
CARDS_PER_MINUTE = 11.5
REPS_PER_NEW_CARD = 2.5