Skip to content

Instantly share code, notes, and snippets.

View s-cotton's full-sized avatar

Stephen Cotton s-cotton

View GitHub Profile
@s-cotton
s-cotton / generateIssueCovers.py
Last active February 20, 2017 18:32
Extract Issue Covers from all archives in folder
#!/usr/bin/env python
import re
import os, errno
import sys
import zipfile
import rarfile
from PIL import Image
import StringIO
@s-cotton
s-cotton / gist:2046177
Created March 15, 2012 19:16
Flat HTML Structure
<!-- The home page images page is currently set up like so -->
<p><img alt="" class="aligncenter size-full wp-image-365" height="418" src="http://hollisinteractive.com/wp-content/uploads/2010/08/Chunkys-22.png" title="Chunky's Cinema Restaurant" width="960" /></p>
<p><img alt="" class="alignnone size-full wp-image-125" height="370" src="http://hollisinteractive.com/wp-content/uploads/2010/09/modelbride.png" style="" title="Model Bride" width="960" /></p>
<p><img alt="" class="alignnone size-full wp-image-127" height="370" src="http://hollisinteractive.com/wp-content/uploads/2010/08/T7.png" style="" title="Tandem Seven" width="960" /></p>
<p>&nbsp;</p>
<div>
<p>&nbsp;</p>
<p><img alt="" class="alignnone size-full wp-image-126" height="370" src="http://hollisinteractive.com/wp-content/uploads/2010/09/poshmom.png" style="" title="Posh Mom" width="960" /></p>
<p>&nbsp;</p>
</div>
function date(format,timestamp){var that=this,jsdate,f,formatChr=/\\?([a-z])/gi,formatChrCb,_pad=function(n,c){if((n=n+'').length<c){return new Array((++c)-n.length).join('0')+n;}
return n;},txt_words=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"];formatChrCb=function(t,s){return f[t]?f[t]():s;};f={d:function(){return _pad(f.j(),2);},D:function(){return f.l().slice(0,3);},j:function(){return jsdate.getDate();},l:function(){return txt_words[f.w()]+'day';},N:function(){return f.w()||7;},S:function(){var j=f.j();return j<4|j>20&&['st','nd','rd'][j%10-1]||'th';},w:function(){return jsdate.getDay();},z:function(){var a=new Date(f.Y(),f.n()-1,f.j()),b=new Date(f.Y(),0,1);return Math.round((a-b)/864e5)+1;},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3),b=new Date(a.getFullYear(),0,4);return _pad(1+Math.round((a-b)/864e5/7),2);},F:function(){return txt_words[6+f.n()];},m:function(){return _pad(
function date(format,timestamp){var that=this,jsdate,f,formatChr=/\\?([a-z])/gi,formatChrCb,_pad=function(n,c){if((n=n+'').length<c){return new Array((++c)-n.length).join('0')+n;}
return n;},txt_words=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"];formatChrCb=function(t,s){return f[t]?f[t]():s;};f={d:function(){return _pad(f.j(),2);},D:function(){return f.l().slice(0,3);},j:function(){return jsdate.getDate();},l:function(){return txt_words[f.w()]+'day';},N:function(){return f.w()||7;},S:function(){var j=f.j();return j<4|j>20&&['st','nd','rd'][j%10-1]||'th';},w:function(){return jsdate.getDay();},z:function(){var a=new Date(f.Y(),f.n()-1,f.j()),b=new Date(f.Y(),0,1);return Math.round((a-b)/864e5)+1;},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3),b=new Date(a.getFullYear(),0,4);return _pad(1+Math.round((a-b)/864e5/7),2);},F:function(){return txt_words[6+f.n()];},m:function(){return _pad(