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
| """ | |
| pywait.py - execute arguments whenever a file changes | |
| Terry N. Brown, [email protected], Mon Dec 12 10:47:49 2016 | |
| """ | |
| import os | |
| import sys | |
| import time |
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
| """ | |
| Using mouse events rather than just moving the cursor is important | |
| """ | |
| import sys | |
| import time | |
| import win32api | |
| import win32con | |
| last = -1 |
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
| """ | |
| Wait 2 seconds then move the active window to the top/bottom | |
| of the left monitor | |
| [email protected], 2016-09-21 | |
| """ | |
| import sys | |
| import win32gui | |
| import win32con |
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
| """ | |
| Open a big red window when a window called r".*Reminder.*" exists. | |
| Because Outlook reminder windows get buried and fail to remind. | |
| Thanks to http://stackoverflow.com/q/18146596/1072212 | |
| [email protected], 2016-09-19 | |
| """ |
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
| GITUSER="$1" | |
| NAME="$2" | |
| if [ -e "$NAME" ]; then | |
| echo "$NAME exists, quitting" | |
| return 10 2> /dev/null || exit 10 | |
| fi | |
| git clone --depth 1 https://github.com/hakimel/reveal.js "$NAME" | |
| if ! cd "$NAME"; then |
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
| """ | |
| cpd.py - copy paste detector | |
| output is stupidly redundant, but works fine to detect duplicate code | |
| Terry Brown, [email protected], Thu Jul 14 14:40:02 2016 | |
| """ | |
| import os | |
| from collections import defaultdict |
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
| find . \( -name HEAD -o -name .git \) -print -prune \ | |
| | xargs -L1 dirname \ | |
| | xargs -IF sh -c ' \ | |
| echo; echo -n F ""; \ | |
| (cd F; git rev-parse --abbrev-ref HEAD); \ | |
| echo "$((cd F; git ls-files --others --exclude-standard) | wc -l) untracked"; \ | |
| (cd F; git remote -v) | sed "s/(.*)//" | sort -u; \ | |
| (cd F; git cherry -v 2>/dev/null); \ | |
| [ -d F/.git ] && (cd F; git -c core.fileMode=false status -uno -s) \ | |
| ' \ |
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
| """ | |
| Quick hack to get read/write access to remote files over port 80 or 443. | |
| WebDAV is probably a better solution, if available. | |
| When it starts, it prints a random key, which must be included in request | |
| headers as X-RandKey. For chrome, you can do this with an extension like | |
| ModHeader. For curl, use | |
| curl -H "X-RandKey: 0.05982546114570.452987805101" ... |
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
| # color version | |
| read -p "Path to other repo.: " OTHER; echo; \ | |
| diff --new-line-format "%c'\033'[31m- %L" \ | |
| --old-line-format "%c'\033'[32m+ %L" --unchanged-line-format '' \ | |
| <(git log --all --format='%H' | sort) \ | |
| <(git -C "$OTHER" log --all --format='%H' | sort); echo -e '\033[0m' | |
| # no color version |
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
| # reveal.js markdown uses two blank lines to separate stacked slides | |
| # and three to separate side by side slides. This snippet reads | |
| # such markdown into the appropriate tree layout in the Leo | |
| # editor (http://leoeditor.com/) | |
| lines = p.b.strip().split('\n') | |
| while lines[0][0] == '@': | |
| del lines[0] | |
| nd = p.insertAfter() |