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/python3 | |
import sys | |
from time import sleep | |
import random | |
for i in range(random.randint(3, 8)): | |
sleep(random.random() / 10) | |
print(f"{sys.argv[1]}, step {i}") | |
if i == 2 and ("arg1" in sys.argv[1] or "arg2" in sys.argv[1]): | |
raise ValueError(f"{sys.argv[1]} raised an exception") |
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
# command: source | |
# Allow autocomplete for conda environments | |
_complete_source_activate_conda(){ | |
if [ ${COMP_WORDS[COMP_CWORD-1]} != "activate" ] | |
then | |
return 0 | |
fi | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
# ls $(path when conda root || path when conda environment activated) |
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
... | |
iplt.pcolormesh(cube) | |
# https://matplotlib.org/gallery/api/image_zcoord.html | |
numrows, numcols = cube.shape | |
def format_coord(x, y): | |
#col = int(x + 0.5) | |
#row = int(y + 0.5) | |
row = int(abs(cube.coord(axis='y').points - y).argmin()) | |
col = int(abs(cube.coord(axis='x').points - x).argmin()) |
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 python2.7 | |
import argparse | |
from difflib import SequenceMatcher | |
import os | |
import subprocess | |
import tempfile | |
def main(old_url, new_url, threshold): | |
OLD_URL, OLD_REV = old_url.split('@') |
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
REPO_BRANCH_PATH=<relative_url> | |
OLD_REV=<old_revision> | |
NEW_REV=<new_revision> | |
OLD_PATH=("<file_path>" \ | |
"<file_path2>" \ | |
) | |
NEW_PATH=("<file_path_new>" \ | |
"<file_path2_new>" \ | |
) |
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 python2.7 | |
""" | |
The following script is used for writing code comments offline and writing | |
them in a format suitable for the given version control software and | |
potentially ticketing system. Example: svn + trac (edgewall). | |
Example usage | |
------------- | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/path/to/python -c "from idlelib.PyShell import main; main()" & |
NewerOlder