Skip to content

Instantly share code, notes, and snippets.

View agoose77's full-sized avatar
🏠
Working from home

Angus Hollands agoose77

🏠
Working from home
View GitHub Profile
@agoose77
agoose77 / .flake8
Last active August 30, 2025 12:52
Launch JupyterLab with basic LSP support
[flake8]
# Match black
max-line-length = 88
# Allow asymmetric commas, etc.
extend-ignore =
E203,
# Spurious warnings in JupyterLab for code cells that follow Markdown cells
E303
exclude = .git,__pycache__,build,dist,.venv
max-complexity = 10
  1. Run npm install
  2. Run npm run build
  3. Use node dist/provision.cjs **/*.md inside your top-level Python virtual environment that is used by MyST to run Jupyter Server
#!/usr/bin/env python3
import re
import sys
import tomllib
import json
import argparse
import pathlib
import shutil
import subprocess
@agoose77
agoose77 / myst-slides.user.js
Last active July 1, 2025 10:04
Simple keyboard shortcuts for slides in MyST
// ==UserScript==
// @name MyST Slides
// @namespace http://tampermonkey.net/
// @version 2025-06-25
// @description Move between pages in MyST. Keys can be set in CSS via `--key-slide-next|prev` on the `:root` elem.
// @author Angus Hollands
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=undefined.localhost
// @grant none
// ==/UserScript==

Hello

::::{figure}

% Figure contents taken from https://github.com/walmes/Tikz :::{tikz} domain=-0.25:9, scale=0.7, >=latex

% \draw[very thin,color=gray!30] (-1.1,-1.1) grid (12.1,7.1); \draw[->] (-0.2,0) -- (9.2,0) node[right] {$x$}; \draw[->] (0,-0.2) -- (0,5.5) node[above] {$Y$};

FROM docker.io/node:24-alpine
RUN wget https://codeload.github.com/myst-templates/book-theme/zip/refs/heads/main -O /tmp/template.zip && \
unzip /tmp/template.zip -d /tmp/ && \
mv /tmp/book-theme-main /app && \
cd /app && \
npm install && \
printf '#!/bin/ash\nexport CONTENT_CDN="$1"\ncd /app\nnode server.js' > ./entrypoint && \
chmod +x ./entrypoint
ENTRYPOINT ["/app/entrypoint"]
# See docs at: https://mystmd.org/guide/frontmatter
version: 1
project:
plugins:
- type: executable
path: table-plugin.py
site:
template: book-theme
@agoose77
agoose77 / table-plugin.mjs
Created January 31, 2025 11:14
A plugin to highlight table cells starting with particular substrings
const COLOURS = {
"positively charged": "#CBE4F9",
"negatively charged": "#CDF5F6",
"polar uncharged": "#EFF9DA",
hydrophobic: "#F9EBDF",
"hydrophobic and aromatic": "#F9D8D6",
special: "#D6CDEA",
};
const plugin = {
This file has been truncated, but you can view the full file.
#!/usr/bin/env node
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.