Skip to content

Instantly share code, notes, and snippets.


Jason Neal jason-neal

  • NZ
View GitHub Profile
jason-neal / apply_pre-commit_patch
Last active Aug 1, 2018
Manually apply a pre-commit cached patch.
View apply_pre-commit_patch
# Manual call if pre-commit fails to restore unstaged work
git apply --whitespace=nowarn path\to\patch\patchXXXXXXXXX
# From
# def _git_apply(patch):
# args = ('apply', '--whitespace=nowarn', patch)
# try:
# cmd_output('git', *args, encoding=None)
jason-neal / git-updater
Last active May 2, 2018 — forked from adilbaig/git-updater
A bash script to update your git repos in the background. It also pops up a user notification when a repo is synced
View git-updater
# This is required for `notify-send` to work from within a cron.
# For Ubuntu
# 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)
jason-neal /
Created Jan 12, 2018
Get iterable list of matplotlib styles.
import matplotlib
colors_array = list(matplotlib.colors.cnames.keys())
lines_array = list(matplotlib.lines.lineStyles.keys())
markers_array = list(matplotlib.markers.MarkerStyle.markers.keys())
jason-neal /
Last active Dec 18, 2017
Debugging tests with pycharm, add pytest call to if __name__ == '__main__':
# 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
USER=jason-neal; PAGE=1
curl "$USER/repos?page=$PAGE&per_page=100" |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
You can’t perform that action at this time.