Skip to content

Instantly share code, notes, and snippets.

View HajimeKawahara's full-sized avatar
😀

Hajime Kawahara HajimeKawahara

😀
View GitHub Profile
@nicwolff
nicwolff / gist:2925803
Created June 13, 2012 19:00
'tcsh' Git prompt to show current branch
# 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"
@takluyver
takluyver / make_nb.py
Created July 21, 2016 13:09
Make a notebook from a script
"""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()