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
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 | |
""" | |
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
#!/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 python3 | |
""" | |
Search for orphan files (files that do not belong to any package) | |
""" | |
import fnmatch | |
import os | |
import subprocess | |
import itertools | |
INCLUDES = ('/usr', '/etc', '/opt', '/lib32', '/lib64', '/sbin') |
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 | |
""" | |
create symlinks in binpath for all exectuables in sub-directories | |
within gistpath | |
""" | |
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 python3 | |
""" | |
Find all the VCS controlled directories in a file path | |
""" | |
import argparse | |
import os | |
EXTS = ['.git', '.hg', '.svn', 'CVS'] | |
def find(path): |