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 os | |
LF_BYTES = b'\n' | |
LF_BYTE = b'\n'[0] | |
def get_filetypes(): | |
types = [] | |
for line in open('.gitattributes').readlines(): | |
line = line.split() |
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 os | |
import subprocess | |
def mr_register(root): | |
dirs = os.listdir(root) | |
for _dir in dirs: |
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 subprocess | |
import sys | |
import time | |
def main(): | |
start_time = time.time() | |
subprocess.call(' '.join(sys.argv[1:]), shell=True) | |
delta = time.time() - start_time | |
hours = int(round(delta / 3600, 0)) |
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/bash | |
# | |
# Dump m4a to wav (first step in conversion) | |
mkdir -p output | |
for i in *.mp3 | |
do | |
mplayer -ao pcm:file="output/${i%.mp3}.wav" "$i" | |
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 | |
"""Convert ogg files to mp3""" | |
from optparse import OptionParser | |
import tempfile | |
import os | |
import subprocess | |
class CommandException(Exception): | |
"""Exception that is raised if calling an external command fails""" | |
def __init__(self, command): |
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 datetime | |
import argparse | |
import math | |
import os | |
import sys | |
import time | |
import subprocess | |
def parse_args(): |
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 directories except .svn directories""" | |
import os | |
def remove_non_dot_svn_dirs(root): | |
"""Remove all directories except .svn directories under too""" | |
for dirpath, _, files in os.walk(root): | |
if dirpath.find('.svn') == -1: | |
for afile in files: | |
fullpath = os.path.join(dirpath, afile) |
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 python3 | |
import os | |
import sys | |
import subprocess | |
commandMap = { | |
# Key(command) => Value(Tuple(list of commands to run, whether to ask for confirmation)) | |
'rebase': (['git', 'svn', 'rebase'], False), | |
'diff': (['git', 'diff'], False), | |
'dcommit': (['git', 'svn', 'dcommit'], False), |
NewerOlder