Skip to content

Instantly share code, notes, and snippets.

View joshfriend's full-sized avatar

Josh Friend joshfriend

View GitHub Profile
@joshfriend
joshfriend / commands.sh
Last active August 29, 2015 14:02
Interesting commands
# Count file types in an SVN repo
svn ls -R http://url/to/repo | tr '[:upper:]' '[:lower:]' | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n
# Get the total SVN repo size on server and file count
svn list -vR http://url/to/repo | awk '{if ($3 !="") sum+=$3; i++} END {print "\ntotal size= " sum/1048576" MB" "\nnumber of files= " i/1000 " K"}'
@joshfriend
joshfriend / showrename.py
Last active August 29, 2015 14:00
TV show auto-filer
#!/usr/bin/env python
import os
import re
from path import path
import shutil
import argparse
# Regexp to match show name, season, episode, file ext
SHOW_RE1 = r'(\S+)(\d{4})?.[Ss](\d+)[Ee](\d+).*.(\w{3})'
@joshfriend
joshfriend / subl
Created March 28, 2014 15:45
Shell wrapper for Sublime Text 3 in Cygwin
#!/bin/bash
for f in $@
do
# Wrap file paths with `cygpath` to allow POSIX pathnames
/cygdrive/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe `cygpath -w $f` &
done
@joshfriend
joshfriend / .zshrc
Last active August 29, 2015 13:57
My ZSH configuration file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="m"
DEFAULT_USER=JoshFriend