Skip to content

Instantly share code, notes, and snippets.

View earthbound19's full-sized avatar
๐Ÿš€
creative coding

Alex Hall earthbound19

๐Ÿš€
creative coding
View GitHub Profile
@earthbound19
earthbound19 / mediaWikiColorTableSort.sh
Last active January 30, 2016 04:54
Sorts mediaWiki color tables descending in HSL values, using Cygwin (~'nix) sed and sort.
# DESCRIPTION
# Sorts mediaWiki color tables by priority of columns H(ue), S(aturation), L(ightness), descending, using Cygwin (~'nix) sed and sort.
# USAGE
# Call this script with one parameter, being the text file to sort, *inline* -- meaning, THIS WILL DIRECTLY MODIFY whatever text file you pass to it.
## CODE
if [ -a $1_.bk ]
then
echo ~-~-~-~- Backup of input file $1 already exists. Will not execute. Check if the file you passed to this script is already in the state you wish. If not, delete the backup file and run this script against $1 again. ~-~-~-~-
else
@earthbound19
earthbound19 / python: center-aligned columns of string images in a row.txt
Last active August 29, 2015 13:57
Render a horizontal series of multiples of a number, each centered along a grid width, with a font of your choice.
#See "TO CHANGE THE OUTPUT IMAGE, CHANGE THESE VARIABLES," below.
#Render a series of string multiples of a number, each horizontally centered along a tile-length grid; using a font of our choice.
#Started 2014-03-15 (Sat Mar 15) 04.53.40 PM RAH
#Horked and extended from:
#http://stackoverflow.com/questions/15857117/python-pil-text-to-image-and-fonts
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
import math