Skip to content

Instantly share code, notes, and snippets.

@minrk
Created February 19, 2013 03:21
Show Gist options
  • Save minrk/4982809 to your computer and use it in GitHub Desktop.
Save minrk/4982809 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Carreau
Copy link

Carreau commented Feb 19, 2013

I would probably use $.getScript('/static/.js') to load the extension as a separate file (then you just have a bunch of getScript in your custom.js) and listen for the 'notebook.loaded' instead of a timeout.

And this
IPython.notebook.get_cell(-1).set_text(code);
IPython.notebook.get_cell(-1).execute();

can probably directly execute on the kernel without going though a cell.

@slink
Copy link

slink commented Jun 5, 2014

@nicktimko
Copy link

The link GH provides when viewing gist.py (as nice HTML) is https://github.com/minrk/ipython_extensions/raw/master/extensions/gist.py which redirects to the raw.githubusercontent.com domain. Maybe the former is slightly less fragile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment