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
[core] | |
editor = code -nw | |
[alias] | |
st = status | |
ls = log --oneline --decorate | |
lg = log --oneline --decorate --graph | |
ff = merge --ff-only | |
mrg = merge --no-ff | |
ffpull = pull --ff-only | |
co = checkout |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
IPython magics for displaying source code files with syntax highlighting. | |
This uses the Pygments library: http://pygments.org. | |
Two magics are available: | |
%highlight: This uses a terminal formatter and will work in any of IPython's | |
front ends. | |
%highlight_html: This uses an HTML formatter and is best used in the |
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 | |
""" | |
Starts a Tornado static file server in a given directory. | |
To start the server in the current directory: | |
tserv . | |
Then go to http://localhost:8000 to browse the directory. | |
Use the --prefix option to add a prefix to the served URL, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sys | |
from datetime import datetime | |
import orca | |
from caldwr.parsers.precipout import load_precipout | |
# this will be replaced when calling orca.run, but it's good to | |
# have a placeholder here so things don't crash when evaluating | |
# stuff ala carte or with orca-server. |
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 subprocess | |
import tempfile | |
import time | |
from IPython.core.magic import register_line_cell_magic | |
def snakeviz(line, cell=None): | |
""" | |
Profile code and display the profile in Snakeviz. |
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
function condalist -d 'List conda environments.' | |
for dir in (ls $HOME/miniconda3/envs) | |
echo $dir | |
end | |
end | |
function condactivate -d 'Activate a conda environment' -a cenv | |
if test -z $cenv | |
echo 'Usage: condactivate <env name>' | |
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 | |
""" | |
Prepare an HTML file from SnakeViz for use as a static page. | |
This makes it so all static files are loaded from a CDN instead | |
of from the local server. | |
To get the SnakeViz HTML file run the snakeviz CLI to load a profile | |
in your browser, than save that page as an HTML file to your computer. | |
Finally, run this script on that HTML file. |