diff --git a/dotfiles/emacs.d b/dotfiles/emacs.d index 30e294b7..247fecd4 160000 --- a/dotfiles/emacs.d +++ b/dotfiles/emacs.d @@ -1 +1 @@ -Subproject commit 30e294b77b1d8d8b9367cc74c1ba307752641494 +Subproject commit 247fecd40e840e5fe5b803eccf073df2832e251a diff --git a/dotfiles/lib/python/git_diff_replacing.py b/dotfiles/lib/python/git_diff_replacing.py new file mode 100755 index 00000000..feaf4cdc --- /dev/null +++ b/dotfiles/lib/python/git_diff_replacing.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +import argparse + +from iterpipes import * + + +class GitDiffReplacer(object): + + def __init__(self, string_to_replace, replacing_string, + source_ref='HEAD~1', destination_ref='HEAD', + verbose=False): + self.source_ref = source_ref + self.destination_ref = destination_ref + self.string_to_replace = string_to_replace + self.replacing_string = replacing_string + self.verbose = verbose + + + @property + def modified_files_command(self): + return linecmd('git diff {} {} --name-only', self.source_ref, + self.destination_ref) + + def git_diff_command(self, filename): + return cmd('git diff {}:{} {}:{}', self.source_ref, filename.strip(), + self.destination_ref, self.perform_substitutions(filename).strip()) + + def perform_substitutions(self, filename): + return filename.replace(self.string_to_replace, self.replacing_string) + + def filter_filenames(self, filenames): + for filename in filenames: + if not self.replacing_string in filename: + yield filename + + def run(self): + return '\n'.join([ + list(run(self.git_diff_command(filename)))[0] + for filename in self.filter_filenames( + run(self.modified_files_command) + ) + ]) + + +if __name__ == '__main__': + import sys + print GitDiffReplacer(sys.argv[1], sys.argv[2]).run() \ No newline at end of file diff --git a/dotfiles/lib/shellrc/aliases.sh b/dotfiles/lib/shellrc/aliases.sh index 66a89c72..dd437ca4 100644 --- a/dotfiles/lib/shellrc/aliases.sh +++ b/dotfiles/lib/shellrc/aliases.sh @@ -1,9 +1,9 @@ - alias emacs="emacsclient -t" alias tmux="tmux -2" alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard' alias timestamp='date +%s' alias go2dotfiles='cd $(dirname `readlink -f ~/.zshrc | xargs dirname`)' +alias fn='find . -name ' # enables the sudoing of aliases. alias sudo='sudo ' diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 6d699ad6..ace4215a 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -1,2 +1,3 @@ source ~/.lib/shellrc.sh -source ~/.lib/zsh.sh \ No newline at end of file +source ~/.lib/zsh.sh +test -r ~/.custom.zsh && source ~/.custom.zsh \ No newline at end of file diff --git a/resources/brew.sh b/resources/brew.sh index a816e5da..a708b040 100755 --- a/resources/brew.sh +++ b/resources/brew.sh @@ -33,6 +33,8 @@ brew install reattach-to-user-namespace brew install daemonize ln -s /usr/local/Cellar/daemonize/1.7.4/sbin/daemonize /usr/local/bin/daemonize brew install ngrep +brew install watch +brew install gist # Remove outdated versions from the cellar brew cleanup