Skip to content

Instantly share code, notes, and snippets.

@jsundram
jsundram / github-pandoc.css
Last active January 13, 2024 20:49 — forked from dashed/github-pandoc.css
Forked copy, incorporating changes suggested on the comment thread from @timfoster and @nightroman (`55em` vs `44em` and `overflow-x: scroll;`). Use as follows: `pandoc -s -f gfm -t html5 -o readme.html README.md -c github-pandoc.css`
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@jsundram
jsundram / connections.py
Created November 17, 2023 20:23
Use word embeddings to generate better guesses at NYT Connections. TODO: come up with an algorithm to actually solve connections... https://www.nytimes.com/games/connections
from collections import defaultdict
from scipy import spatial
from sklearn.manifold import TSNE
from sklearn.cluster import SpectralClustering, KMeans
import functools
import heapq
import matplotlib.pyplot as plt
import numpy as np
import os
@jsundram
jsundram / boxed.py
Last active May 26, 2025 11:34
Solve the NY Times' Letter Boxed game in 2 guesses (modified version of KV's code/algorithm)
from time import time
import re
import sys
def get_words(filename='words.txt'):
# https://raw.githubusercontent.com/dwyl/english-words/master/words.txt
with open(filename) as f:
return [line.strip() for line in f]
@jsundram
jsundram / README.md
Last active November 18, 2024 15:44

MDB Excavation

MDB is a Microsoft Access Database file. We'd like to look inside of it, but we have a Mac and no MS Office license.

export.py is a program that can do each of the following:

  1. Put each table into its own .csv file to look at.
  2. Put each table in the data into an excel / google sheets doc for easy viewing/browsing
  3. Create a sqlite db which is similarly portable but accessible via a variety of common tools
@jsundram
jsundram / nato.py
Last active October 16, 2023 19:18
Spell out a word (or string) in the Nato Alphabet, in an output format suitable for piping to the MacOS "say" command
import sys
# from https://www.worldometers.info/languages/nato-phonetic-alphabet/
TABLE = """
A Alfa/Alpha ● ▬ AL FAH
B Bravo ▬ ● ● ● BRAH VOH
C Charlie ▬ ● ▬ ● CHAR LEE
D Delta ▬ ● ● DELL TAH
E Echo .● ECK OH
F Foxtrot ● ● ▬ ● FOKS TROT
@jsundram
jsundram / bee.sh
Last active November 4, 2022 18:17
Solving the Spelling Bee (https://www.nytimes.com/puzzles/spelling-bee) with a one-liner in Bash
#!/usr/bin/env bash
# Solve the Spelling Bee (https://www.nytimes.com/puzzles/spelling-bee)
# Usage `./bee.sh ulroapn | more` where the first letter is the one in the middle
# Output: a list of valid dictionary words that contain the first letter and
# no letters that aren't on the list provided.
# Unfortunately the MacOS dictionary has words that aren't in the custom
# Spelling Bee dictionary, so you may find words listed that aren't accepted
@jsundram
jsundram / howtolog.md
Last active August 28, 2022 22:53
How to make a chamber music log (or any other kind of information) using google forms

How to Make a Chamber Music Log

  1. Go to Google Forms https://docs.google.com/forms/u/0/

  2. Create new Form

  3. Screenshot 2017-05-31 11 55 03
    1. Fill it out with the questions that you might like to have. Mine looks like this:
    2. Screenshot 2017-05-31 12 17 39
  4. Click Responses