This file contains 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
#!/bin/sh | |
for file | |
do | |
newfile=`echo $file | sed -e "s/\(.*\)\.jpg/\1_400\.jpg/g"` | |
convert -resize 400x400 $file ../images/$newfile | |
newfile=`echo $file | sed -e "s/\(.*\)\.jpg/\1_150\.jpg/g"` | |
convert -resize 150x150 $file ../images/$newfile | |
done |
This file contains 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 | |
""" | |
Remove all .pyc files in the path recursively | |
""" | |
from __future__ import print_function | |
import argparse | |
import os | |
import shutil |
This file contains 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 | |
""" | |
Synchronize music with a portable device | |
""" | |
import os | |
import subprocess | |
from easygui import msgbox, choicebox, codebox, ynbox, diropenbox | |
def sync_music(): |
This file contains 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 | |
"""A utility for creating a clip of an mp3 file""" | |
import getopt, os, sys | |
from subprocess import Popen, PIPE | |
try: | |
from mutagen.id3 import ID3 | |
except ImportError: | |
print "Missing mutagen. On Debian systems, install python-mutagen" | |
sys.exit(1) |
This file contains 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 python3 | |
import argparse | |
import base64 | |
import xml.etree.ElementTree as ET | |
import urllib.request, urllib.error, urllib.parse | |
import operator | |
import time | |
from canadapostconf import username, password |
This file contains 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
from __future__ import division | |
import random | |
totalPaid=0 | |
numRuns=0 | |
maxRuns=100000 | |
maxRuns=10000 | |
amountCharged=1 | |
def flipCoins(): | |
result=0 | |
num=-1 |
This file contains 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
import types | |
def cachedmethod(function): | |
return types.MethodType(Memoize(function), None) | |
class Memoize: | |
def __init__(self,function): | |
self._cache = {} | |
self._callable = function |
This file contains 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
# mean of n values within an array | |
import numpy, time | |
listSize = 10000 | |
meanLength = 50 | |
def nmean(list,n): | |
a = [] | |
for i in xrange(1,len(list)+1): |
This file contains 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 exif | |
import sys, os, getopt, string, datetime, operator, math | |
import os.path | |
from os.path import splitext | |
EXTS = ['.jpg'] | |
def getFiles(directory): |
This file contains 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 python2 | |
""" | |
Search for swimming lessons on the Vancouver Aquatic Services web page | |
that match certain criteria. | |
""" | |
import urllib2 | |
import json | |
#WP=Lord Byng |