Skip to content

Instantly share code, notes, and snippets.

View damianavila's full-sized avatar

Damian Avila damianavila

View GitHub Profile
from flask import Flask, send_file, send_from_directory
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
NBCONVERT_PATH = '../nbconvert/nbconvert.py'
TARGET_IPYNB = 'presentation.ipynb'
TARGET_HTML = 'presentation_slides.html'
def nbconvert():
#!/usr/bin/env python
"""
simple example script for running notebooks and reporting exceptions.
Usage: `checkipnb.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and checked for errors.
"""
import os,sys,time
"""
usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
"""
import sys
import io
from IPython.nbformat import current
#!/usr/bin/env python
"""
simple example script for running and testing notebooks.
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
import os,sys,time
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""Simple utility script for semi-gracefully downgrading v3 notebooks to v2"""
import io
import os
import sys
from IPython.nbformat import current
def heading_to_md(cell):
"""turn heading cell into corresponding markdown"""

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@damianavila
damianavila / ipynb_run_save.py
Created March 20, 2013 20:49
Run and save a ipynb file from the command line. This script is working in dev version (1.0) of IPython (for previous version you have to tweak it). It will generate a new "run & saved" notebook.
#!/usr/bin/env python
"""
Script for running and save notebooks from command line.
How to use: `ipynb_run_save.py foo.ipynb
Some tweaks over ipydoctest.py from minrk
by @damianavila
"""
@damianavila
damianavila / remove_output.py
Created April 3, 2013 22:05
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write
@damianavila
damianavila / reveal.js
Created June 16, 2013 19:36
Reveal extension for metadata editing.
//----------------------------------------------------------------------------
// Copyright (C) 2012 The IPython Development Team
//
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
//============================================================================
//CellToolbar Example
//============================================================================