This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Compile with pdftex, not pdflatex | |
\def\modulo#1#2{(#1-(#1/#2)*#2)} % a mod n = a-(a/n)*n where / is integer division | |
\newcount\X | |
\X=1 | |
\loop | |
\ifnum \numexpr\modulo{\X}{15} = 0 | |
FizzBuzz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import os | |
try: | |
from pdf2image import convert_from_path | |
from PIL import Image | |
except ImportError: | |
print("You need to run `pip install Pillow pdf2image` before this script") | |
import sys | |
sys.exit(-1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import os | |
def tree(directory=".", indent = " "): | |
""" | |
Helper function that prints the filesystem tree. | |
""" | |
ignorables = ["__pycache__", ".gitignore", ".DS_Store", ".ipynb_checkpoints", ".git", "venv"] | |
for root, dirs, files in os.walk(directory): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Converts an .epub file to .pdf | |
# Requires Calibre and ghostscript to be installed | |
epubfilename="$1" | |
namenoext="$(basename -- "$epubfilename" .epub)" | |
randomstr="$(basename $(mktemp))" | |
tmpfilename1="$namenoext-$randomstr-1.pdf" | |
tmpfilename2="$namenoext-$randomstr-2.pdf" |
OlderNewer