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.