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
# in ~/bin/gitprompt.csh: | |
setenv GIT_BRANCH_CMD "sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'" | |
set prompt="%m:%~ `$GIT_BRANCH_CMD`%B%#%b " | |
# and then in ~/.cshrc: | |
alias precmd "source ~/bin/gitprompt.csh" |
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
"""Create a notebook containing code from a script. | |
Run as: python make_nb.py my_script.py | |
""" | |
import sys | |
import nbformat | |
from nbformat.v4 import new_notebook, new_code_cell | |
nb = new_notebook() |