This file contains hidden or 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
| " syntax on. | |
| " show existing tab with 4 spaces width | |
| set tabstop=4 | |
| " when indenting with '>', use 4 spaces width | |
| set shiftwidth=4 | |
| " On pressing tab, insert 4 spaces | |
| set expandtab |
This file contains hidden or 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
| curl -fsSL https://gist.githubusercontent.com/dafydd/61c8692caf432189655dc2051008ec0e/raw -o deploy.sh && chmod +x deploy.sh |
This file contains hidden or 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 sh | |
| set -eu | |
| BASE="https://gist.githubusercontent.com/dafydd" | |
| BINDIR="$HOME/bin" | |
| ADDENDUMLINE="source $BINDIR/.shell-addendum" | |
| umask 077 | |
| mkdir -p "$BINDIR" |
This file contains hidden or 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
| #-- addendum | |
| export PATH="$HOME/bin:$PATH" | |
| #open will open working dirs implicitly | |
| o() { | |
| if [ $# -eq 0 ]; then | |
| open . | |
| else | |
| open "$@" |
This file contains hidden or 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 bash | |
| #ssum: machine status report | |
| UNAME=`uname` | |
| if [ 'Linux' == "$UNAME" ] | |
| then | |
| MACHINE=`hostname` | |
| OSVERSION=`cat /etc/issue` | |
| IP=`hostname --all-ip-addresses` | |
| fi |
This file contains hidden or 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 | |
| """ | |
| Scan repos for "behind upstream" status (i.e. you need to catch up). | |
| Optionally hints whether a merge would likely be clean (no working tree changes). | |
| Usage: | |
| ./gitcon # scans ~/code | |
| ./gitcon /path/to/src # scan a different base directory | |
| """ |
This file contains hidden or 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 subprocess | |
| def find_git_repos_with_unpushed_commits(base_dir): | |
| messages = [] | |
| for root, dirs, files in os.walk(base_dir): | |
| if '.git' in dirs: | |
| repo_dir = root | |
| try: |
This file contains hidden or 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
| #frequent | |
| alias c="clear;pwd;echo;ls;echo;" | |
| alias e="exit" | |
| alias m="more" | |
| alias sc="cat ~/.aliases" | |
| alias u="cd .." | |
| alias u2="cd ../.." | |
| alias u3="cd ../../.." | |
| alias lsa='ls -la --si' | |
| alias l='ls -la --si' |