Skip to content

Instantly share code, notes, and snippets.

Jack Morgan JackMorganNZ

Block or report user

Report or block JackMorganNZ

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JackMorganNZ
JackMorganNZ / cs4hs-boxes.py
Last active Dec 4, 2017
CS4HS box image generator
View cs4hs-boxes.py
import csv
from PIL import Image, ImageDraw
RAW_DATA = "data.csv"
GRID_SIZE = 6
BOX_SIZE = 10
IMAGE_SIZE = (GRID_SIZE * BOX_SIZE, GRID_SIZE * BOX_SIZE)
with open(RAW_DATA) as csvfile:
@JackMorganNZ
JackMorganNZ / create_math_equation_image.py
Created Jun 1, 2016
Example Python script for creating .png files for LaTeX math equations
View create_math_equation_image.py
import os, requests
def formula_as_file( formula, file):
formula = formula.replace('\n', ' ')
r = requests.get( 'http://latex.codecogs.com/png.latex?\dpi{{300}} {formula}'.format(formula=formula))
print('http://latex.codecogs.com/gif.latex?%5Cdpi%7B300%7D%20%5Cbegin%7Bbmatrix%7D%202%20%26%200%20%5C%5C%200%20%26%202%20%5C%5C%20%5Cend%7Bbmatrix%7D')
print(r.url)
f = open(file, 'wb')
f.write(r.content)
f.close()
@JackMorganNZ
JackMorganNZ / gist:d051a12e44ec4ce08639
Last active Nov 28, 2015
Instructions for CSFG Gource animation
View gist:d051a12e44ec4ce08639
git log --all --reverse --pretty=format:"%ct|%s" > log.txt
gource --title "Computer Science Field Guide Development" --dir-name-depth 2 --key --highlight-dirs --highlight-users --output-framerate 30 --caption-file log.txt --caption-duration 4 -f --viewport 1920x1080 --hide progress --hide mouse --stop-at-end --font-size 34 --caption-size 24
@JackMorganNZ
JackMorganNZ / chapter_folder_creator.py
Last active Aug 29, 2015
Python script for creating chapter folders and base files
View chapter_folder_creator.py
import os
folders = ["algorithms",
"artificial_intelligence",
"complexity_tractability",
"coding_introduction",
"coding_compression",
"coding_encryption",
"coding_error_control",
"computer_graphics",
You can’t perform that action at this time.