Skip to content

Instantly share code, notes, and snippets.

View scmbradley's full-sized avatar

Seamus Bradley scmbradley

View GitHub Profile
from collections import Counter
# Download a wordlist such as the one available here:
# https://github.com/dwyl/english-words
with open("../resources/words/words_alpha.txt") as d:
wl = [x.strip() for x in d.readlines()]
firsts = [x[0] for x in wl]
fives = [x for x in wl if len(x) == 5]
from collections import Counter
with open("08-data") as d:
data = [x.strip().split("|") for x in d.readlines()]
# Each segment appears a certain number of times in the digits 0--9
# Each number has a unique pattern of segment occurences.
# So first, build a dictionary mapping segment occurence patterns to
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
% Give three nodes names
\coordinate (a) at (90:3cm);
\coordinate (b) at (210:3cm);
@scmbradley
scmbradley / simple-arrows.tex
Created June 8, 2021 07:23
Simple demonstration of TikZ
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[very thick,-stealth]
\node (a) {A};
\node [above right = 2em and 5em of a] (b) {B};
\node [below right= 1em and 2em of a](d) {D};
\node [right = 1em of d](c) {C};
@scmbradley
scmbradley / linker.py
Created April 3, 2021 19:34
Script to automatically create symlinks to config files
#!/usr/bin/env python3
from pathlib import Path
from subprocess import run
# DOTFILES is the path to where you store your dotfiles
DOTFILES = Path.home().joinpath(".dotfiles/")
# SHELL_CMD should output a list of paths to files in your dotfiles directory
# They should be separated by newlines (\ņ)
@scmbradley
scmbradley / conference.cls
Created May 14, 2014 15:59
This is a sort-of-working version of a LaTeX class I'm working on for typesetting conference programmes.
%% conference.cls
%% Copyright 2014 Seamus Bradley
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
@scmbradley
scmbradley / gist:822174
Created February 11, 2011 10:24
vollkorn mwe with microtype
Running `LaTeX' on `test' with ``pdflatex -interaction=nonstopmode "\input" test.tex''
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
restricted \write18 enabled.
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, nohyphenation, ibycus, monogreek, greek, ancientgreek, loaded.
(./test.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
@scmbradley
scmbradley / fontfail.log
Created January 24, 2011 13:52
ccicons fails to compile
Running `LaTeX' on `reporttest' with ``pdflatex -interaction=nonstopmode "\input" reporttest.tex''
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
restricted \write18 enabled.
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, nohyphenation, ibycus, monogreek, greek, ancientgreek, loaded.
(./reporttest.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty