Skip to content

Instantly share code, notes, and snippets.

@jsundram
jsundram / visual-diff-report-dark.html
Last active January 20, 2026 04:41
Visual Diff Report - Boccherini Quartets (dark mode)
<!DOCTYPE html>
<html>
<head><title>Test Report (Dark)</title></head>
<body>
<div style="background: #fff3cd; border: 1px solid #ffc107; padding: 10px; margin-bottom: 20px; border-radius: 4px;">
<strong>Shared Report</strong> - This is a self-contained visual diff report.
Images are embedded as base64.
</div>
<h1>Visual Diff Report - Test (Dark Mode)</h1>
@jsundram
jsundram / visual-diff-report.html
Last active January 20, 2026 04:41
Visual Diff Report - Boccherini Quartets
<!DOCTYPE html>
<html>
<head><title>Test Report</title></head>
<body>
<div style="background: #fff3cd; border: 1px solid #ffc107; padding: 10px; margin-bottom: 20px; border-radius: 4px;">
<strong>Shared Report</strong> - This is a self-contained visual diff report.
Images are embedded as base64.
</div>
<h1>Visual Diff Report - Test (Light Mode)</h1>
@jsundram
jsundram / README.md
Last active January 16, 2026 04:15
Periodic Table of Boccherini String Quartets

Periodic Table of Boccherini String Quartets

An interactive visualization of Luigi Boccherini's complete string quartet output (1761-1804), displayed as a periodic table-inspired grid.

View it (via gisthack, see below for details):

Updating the Gist

from itertools import permutations
def main():
A = [24, 3, 'A', 6, 27, 0, 9, 'AB', 17, 'ABC', 14, 'AC']
B = [20, 4, 23, 7, 'B', 1, 26, 'BC', 16, 'ABC', 17, 'AB']
C = [11, 5, 22, 8, 'C', 2, 25, 'AC', 14, 'ABC', 16, 'BC']
# Figure out what numbers are missing.
N = list(range(28))
n = set(i for i in A + B + C if type(i) == int)
@jsundram
jsundram / pentagons.html
Last active December 29, 2025 05:14
flowers with geometric petals
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pentagon Flower Generator</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 1200px;
@jsundram
jsundram / color_names.py
Last active January 31, 2025 05:10
Trying to find names for colors. Takes the html code for a color (e.g. "#30c5ff" and finds the closest XKCD color name (https://xkcd.com/color/rgb/ and https://blog.xkcd.com/2010/05/03/color-survey-results/)
from matplotlib.colors import hex2color, rgb_to_hsv, XKCD_COLORS, CSS4_COLORS
import matplotlib.pyplot as plt
import numpy as np
class ColorNames:
def __init__(self, color_dict, converter=hex2color):
"""
color dict: A map of names to hex values.
converter: A function that takes a hex color and returns an array.
@jsundram
jsundram / rainbow.py
Created January 27, 2025 05:57
multicolored text strings in matplotlib / python
import matplotlib.pyplot as plt
from matplotlib import transforms
# See https://stackoverflow.com/a/79389836/2683
plt.style.use('classic')
def multicolored_text(x, y, text, cd, **kw):
"""
Place text at (x, y) with colors for each word specified in the color
dictionary cd, which maps strings to colors, and must include a 'default'
@jsundram
jsundram / get_checkins.py
Last active February 19, 2024 00:30
Get my Swarm checkins from Foursquare
import requests
from datetime import datetime
import json
"""
Instructions:
1. go to https://swarmapp.com/history
2. open developer tools in browser, and navigate to the "network" tab.
3. filter for fetch/XHR
4. select a month in the dropdown
@jsundram
jsundram / Haydn-076_2-wp4tet.md
Created January 16, 2024 20:03
Haydn: String Quartet in d, Op 76 Nr. 2 Program Notes from Willow Pond String Quartet 1997 concert (from https://www.bobrej.com/picnic/1997.htm)

Haydn: String Quartet in d, Op 76 Nr. 2 "Quinten"

  1. Allegro
  2. Andante o più tosto Allegretto
  3. Menuetto
  4. Finale. Vivace assai

haydn - wpq

Of humble origins, Franz Joseph Haydn was born in Rohrau, near Vienna, on 31 March 1732. When eight years old he was accepted into the choir school of Saint Stephen's Cathedral in Vienna, where he received his only formal education. Dismissed from the choir at the age of seventeen, when his voice broke, he spent the next several years as a struggling freelance musician. In 1755 Haydn was engaged briefly by Baron Karl Josef von Fürnberg, for whom he apparently composed his first string quartets. Haydn's marriage in 1760 to Maria Anna Keller proved to be unhappy. The turning point in Haydn's fortunes came in 1761, when he was appointed assistant music director to Prince Pál Antal Esterházy; a year later he became full director. As Kapellmeister, Haydn served under the patronage of thre

@jsundram
jsundram / Haydn-020_4-wp4tet.md
Last active January 16, 2024 20:03
Haydn: String Quartet in D, Op 20 Nr. 4 Program Notes from Willow Pond String Quartet 1996 concert (from https://www.bobrej.com/picnic/1996.htm)

Haydn: String Quartet in D, Op 20 Nr. 4

  1. Allegro di molto
  2. Un poco Adagio affettuoso (Theme with variations)
  3. Menuetto: Allegretto all zingarese
  4. Finale. Presto scherzando

haydn - wpq

Of humble origins, Franz Joseph Haydn was born in the village of Rohrau, near Vienna, on March 31, 1732. When eight years old he was accepted into the choir school of Saint Stephen's Cathedral in Vienna, where he received his only formal education. Dismissed from the choir at the age of seventeen, when his voice broke, he spent the next several years as a struggling freelance musician. He studied on his own the standard textbooks on counterpoint and took occasional lessons from the noted Italian singing master and composer Nicola Porpora. In 1755 Haydn was engaged briefly by Baron Karl Josef von Fürnberg, for whom he apparently composed his first string quartets. Haydn's marriage in 1760 to Maria Anna Keller proved to be unhappy.