Skip to content

Instantly share code, notes, and snippets.

Fabrice Brito fabricebrito

Block or report user

Report or block fabricebrito

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View notebooks2sphinx.py
"""This script will look for all .ipynb files in source_dir and convert them on the same place to
.rst files.
It is used in order to integrate notebooks output to sphinx documentation.
Read it, use it, hack it and share it ! Or you can do better writing a sphinx extension :-)
:Url:
https://gist.github.com/hadim/16e29b5848672e2e497c
:Author:
@takluyver
takluyver / README.md
Created Sep 6, 2014
Flatten notebooks for git diff
View README.md

Copy nbflatten.py to somewhere on $PATH. Then, in the root of a git repository, run these commands:

echo "*.ipynb diff=ipynb" >> .gitattributes 
git config diff.ipynb.textconv nbflatten.py

When you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.

This doesn't help with merging conflicting changes in notebooks. For that, see nbdiff.org.

@fperez
fperez / ProgrammaticNotebook.ipynb
Last active Oct 19, 2019
Creating an IPython Notebook programatically
View ProgrammaticNotebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lttlrck
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
You can’t perform that action at this time.