This file contains 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
#https://stackoverflow.com/questions/19576742/how-to-clone-all-repos-at-once-from-github | |
USER=jason-neal; PAGE=1 | |
curl "https://api.github.com/users/$USER/repos?page=$PAGE&per_page=100" | | |
grep -e 'git_url*' | | |
cut -d \" -f 4 | | |
xargs -L1 git clone |
This file contains 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
# https://stackoverflow.com/questions/14086067/debugging-pytest-post-mortem-exceptions-in-pycharm-pydev | |
# Are you using pytest-pycharm plugin? | |
# Looks like it works for me. Create virtualenv, pip install pytest pytest-pycharm, | |
# use this virtualenv at PyCharm Edit configuration -> Python Interpreter and | |
# then run with Debug ... Example: | |
import pytest | |
def test_me(): | |
assert None |
This file contains 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
import matplotlib | |
colors_array = list(matplotlib.colors.cnames.keys()) | |
lines_array = list(matplotlib.lines.lineStyles.keys()) | |
markers_array = list(matplotlib.markers.MarkerStyle.markers.keys()) |
This file contains 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
#!/bin/bash | |
# This is required for `notify-send` to work from within a cron. | |
# For Ubuntu | |
# http://askubuntu.com/questions/298608/notify-send-doesnt-work-from-crontab/346580#346580 | |
# eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; | |
# For Fedora | |
export DISPLAY=:0.0 | |
export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME session)/environ) |
This file contains 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
# Manual call if pre-commit fails to restore unstaged work | |
git apply --whitespace=nowarn path\to\patch\patchXXXXXXXXX | |
# From https://github.com/pre-commit/pre-commit/blob/c3c6175c94ac043b0e6597238f712b615fbdb45f/pre_commit/staged_files_only.py | |
# def _git_apply(patch): | |
# args = ('apply', '--whitespace=nowarn', patch) | |
# try: | |
# cmd_output('git', *args, encoding=None) |