View resize-image-keep-aspect-ratio.py
#Resizes an image and keeps aspect ratio. Set mywidth to the desired with in pixels.
import PIL
from PIL import Image
mywidth = 300
img = Image.open('someimage.jpg')
wpercent = (mywidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
View generate-year-select-menu.py
#Python script to generate year select menu.
print '<select name="year">'
for i in range(2013,2051):
print '<option value="'+str(i)+'">'+str(i)+'</option>'
print '</select>'
View generate-google-fonts-stylesheet-links.py
View python-create-jekyll-post.py
import os
from datetime import datetime
import time
import slugify
#Generate timestamps for post id and date.
ts = time.time()
timeid = datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
timestamp = datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
View python-generate-states-select-menu.py
states = ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]
for s in states:
print '<option value="'+s+'">'+s+'</option>'