Info about grep / examples
Usage: grep [OPTION]... PATTERN [FILE]... (a few options / a few files can be passed at once)
| # Status | |
| git config --global alias.s 'status -s' | |
| # List | |
| git config --global alias.ls 'log --pretty=format:"%C(yellow)%h%C(red)%d %C(reset)%s %C(cyan) [%cn]" --decorate' | |
| # List w/ date | |
| git config --global alias.ld 'log --pretty=format:"%C(yellow)%h %ad%C(red)%d %C(reset)%s%C(cyan) [%cn]" --decorate --date=short' | |
| # List w/ relative date | |
| git config --global alias.lr 'log --pretty=format:"%C(yellow)%h %ad%C(red)%d %C(reset)%s%C(cyan) [%cn]" --decorate --date=relative' | |
| # List w/ numstat | |
| git config --global alias.ln 'log --pretty=format:"%C(yellow)%h%C(red)%d %C(reset)%s%C(cyan) [%cn]" --decorate --numstat' |
| import functools | |
| def memoize(outer_func): | |
| """Memoize everything.""" | |
| @functools.wraps(outer_func) | |
| def inner_func(*args, _cache={}): | |
| if args in _cache: | |
| return _cache[args] | |
| _cache[args] = outer_func(*args) | |
| return _cache[args] |