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
type: map_type | base_type | |
map_type: | |
'map' '<' base_type ',' 'map' '<' base_type ',' type '>>' | | |
'map' '<' base_type ',' type '>' | |
base_type: NAME |
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
#!/usr/bin/env bash | |
_usage() { | |
printf 'usage: %s [-p|--poll <sec per poll>] [-a|--all] [<find args>] -- <command> [<args>]\n' "$(basename "$0")" >&2 | |
exit 64 | |
} | |
# Default arg values | |
sec_per_poll=2 | |
find_all=false |
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
#!/usr/bin/env python3 | |
import argparse | |
import json | |
import sys | |
parser = argparse.ArgumentParser(description='Manipulate JSON documents.') | |
parser.add_argument( | |
'-i', '--indent', | |
metavar='N', |
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 parsimonious | |
parser = parsimonious.Grammar(r""" | |
type = tuple_type / basic_type | |
tuple_type = "(" type next_type* ")" | |
next_type = "," type | |
basic_type = base sub? arrlist? |
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 parsimonious | |
parser = parsimonious.Grammar(r""" | |
type = tuple_type / basic_type | |
tuple_type = "(" type ("," type)* ")" | |
basic_type = base sub? arrlist? | |
base = alphas |
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
Python 3.6.4 (default, Mar 14 2018, 11:02:01) | |
Type 'copyright', 'credits' or 'license' for more information | |
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. | |
In [1]: from functools import lru_cache | |
In [2]: class Adder: | |
...: def __init__(self, n): | |
...: self.n = n | |
...: @lru_cache() |
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
### Keybase proof | |
I hereby claim: | |
* I am davesque on github. | |
* I am davesque (https://keybase.io/davesque) on keybase. | |
* I have a public key ASBC7aMNHRFEsxDO5vTmv0J7abJGTOG5J2Fk2zBCC3lw0go | |
To claim this, I am signing this object: |
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
__simple_upsearch() { | |
if [[ -e $1 ]]; then | |
[[ $PWD == / ]] \ | |
&& printf '/%s' "$1" \ | |
|| printf '%s/%s' "$PWD" "$1" | |
return 0 | |
fi | |
[[ $PWD == / ]] && return 1 |
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
#!/usr/bin/env python | |
import os | |
from matplotlib.widgets import Slider, Button | |
from scipy.ndimage.filters import gaussian_filter | |
from scipy.ndimage.morphology import grey_dilation | |
import django | |
import matplotlib.pyplot as plt | |
import numpy as np |
NewerOlder