add custom.zsh source in zshrc and watch and gist to brew.sh bump emacs.d pointer.
This commit is contained in:
parent
d66dc2e236
commit
8db598c78d
@ -1 +1 @@
|
||||
Subproject commit 30e294b77b1d8d8b9367cc74c1ba307752641494
|
||||
Subproject commit 247fecd40e840e5fe5b803eccf073df2832e251a
|
47
dotfiles/lib/python/git_diff_replacing.py
Executable file
47
dotfiles/lib/python/git_diff_replacing.py
Executable file
@ -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()
|
@ -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 '
|
||||
|
@ -1,2 +1,3 @@
|
||||
source ~/.lib/shellrc.sh
|
||||
source ~/.lib/zsh.sh
|
||||
source ~/.lib/zsh.sh
|
||||
test -r ~/.custom.zsh && source ~/.custom.zsh
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user