Skip to content

Instantly share code, notes, and snippets.

@basus
basus / thompsons.tex
Created January 26, 2018 18:19
Tikz diagram for Thompson's Construction of Finite Automata from Regular Expressions
\usepackage{subcaption,tikz}
\usetikzlibrary{arrows.meta,bending,automata,shapes}
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.3\textwidth}
\begin{tikzpicture}[->,>={Stealth[round]},shorten >=1pt,auto,semithick]
\tikzstyle{vertex}=[circle,draw=black,minimum size=30pt,inner sep=0pt]
\node[vertex] (q)[initial, initial where=left,initial text={}]
at (1,0) {$q$};
@basus
basus / docker.sh
Created September 13, 2018 18:37
Docker shortcuts
# Start a container from an image, daemonized, with port forwarding.
# This runs whatever CMD the image is set to run.
docker run -d -p 8000:8000 <image name>
# Run a bash shell in a already-running container.
# Exiting this shell will stop the container.
docker exec -it <container name/id> bash
# Restart the container. This is required after exiting a shell running
# on it via the above command. This is also required if a container is
@basus
basus / pollen.makefile
Created June 27, 2019 20:23
Makefile for my pollen-based website
.POSIX:
default: render publish
css: css/theme.css
top: index.html template.html error.html css js/
about: about/index.html about/pollen.rkt
@basus
basus / keybase.md
Created August 26, 2019 01:15
Keybase verification

Keybase proof

I hereby claim:

  • I am basus on github.
  • I am basus (https://keybase.io/basus) on keybase.
  • I have a public key ASA8O-6_xzXHxTJ5qyHuPHstyRf_LAhoTup5-XF2piBqPQo

To claim this, I am signing this object:

@basus
basus / WithDefault.cpp
Created March 15, 2023 01:03
Avoiding adding a default method to the subclass
class SuperClass {
void defaultDummyMethod() {
// This is the no-op dummy method that will be overriden in some child class
doNothing();
}
void actualMethod() {
// This has lots of gnarly code, plus a call to the dummy method,
// even though this class doesn't need to call the dummy method.
@basus
basus / doom-info.txt
Created April 26, 2026 01:14
Doom Emacs info for package-lint upgrade failure
generated Apr 25, 2026 18:13:42
system MacOS 26.4.1 Darwin 25.4.0 arm64
emacs 31.0.50 EMACSDIR=~/Public/doom-emacs/
EMACS=/opt/homebrew/Cellar/emacs-plus@31/31.0.50/Emacs.app/Contents/MacOS/Emacs
doom 2.1.0 PROFILE=_default@0 HEAD -> master 3baa406d6 2026-04-24
08:32:41 -0400 ~/.doom.d/
shell /bin/zsh
features ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS
TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB