Skip to content

Instantly share code, notes, and snippets.

View ktychan's full-sized avatar

Kelvin T. Y. Chan ktychan

View GitHub Profile
N = (0,1)
E = (1,0)
def normalize(path):
""" convert path to a list of (0,1) and (1,0) """
l = len(path)
if l % 2 != 0:
raise ValueError("Not a lattice path: len(path)=%d is not even." % l)
@ktychan
ktychan / a0_landscape_dotted.tex
Created November 10, 2018 19:25
PDF templates
% blank dotted paper
\documentclass[a0,landscape]{a0poster}
\usepackage{background}
\usetikzlibrary{decorations.markings,calc}
\def\Step{0.5} %% separation between dots
\def\Size{0.5pt} %% radius of the dot
\def\Toty{40} %% adjust
\def\Totx{100} %% adjust
@ktychan
ktychan / bash-cheatsheet
Created October 2, 2014 18:39
cheatsheets
____ _ ____ _ _ ____ _ _ _ _
| __ ) / \ / ___|| | | | / ___| |__ ___ __ _| |_ ___| |__ ___ ___| |_
| _ \ / _ \ \___ \| |_| | | | | '_ \ / _ \/ _` | __/ __| '_ \ / _ \/ _ \ __|
| |_) / ___ \ ___) | _ | | |___| | | | __/ (_| | |_\__ \ | | | __/ __/ |_
|____/_/ \_\____/|_| |_| \____|_| |_|\___|\__,_|\__|___/_| |_|\___|\___|\__|
kelvinchan.ca
Comparison
==========