Skip to content

Instantly share code, notes, and snippets.

View Zsailer's full-sized avatar

Zachary Sailer Zsailer

View GitHub Profile
@Zsailer
Zsailer / multidirectory.md
Last active December 15, 2015 17:19
An outline of the architecture for a multi-directory file-system in IPython notebook's dashboard.

Architecture of IPython notebook's Dashboard

The tables below show the current RESTful web service architecture implemented in IPython notebook. The listed URL's use the HTTP verbs to return representations of the desired resource.

We are in the process of creating a new dashboard architecture for the IPython notebook, which will allow the user to navigate through multiple directory files to find desired notebooks.

Current Architecture

This chart shows the web-services in the single directory IPython notebook.

@Zsailer
Zsailer / ipymultimapping.md
Last active December 16, 2015 01:39
IPEP: URL mapping for the IPython notebook multi-directory dashboard

A Multi-directory IPython notebook dashboard

Author: Zach Sailer <zachsailer@gmail.com>

Created: 2013-4-10

Updated: 2013-4-10

Abstract

@Zsailer
Zsailer / notebooks.py
Created April 11, 2013 23:28
List of dicts returned in IPython's multi-directory webservice ~ "/notebooks/foo/bar"
{ "path": "foo/bar",
"notebooks":[{{"kernel_id":"###","name":"Notebook1","notebook_id":"###"}},{...}],
"directories": ["sub-directory1", "sub-directory2", ...],
"files":["file1","file2",...]
}
@Zsailer
Zsailer / webservicedoc.md
Last active December 18, 2015 10:18
IPython's new web-service documentation

IPython Web Services

This documentation describes the current API for IPython Notebook's web-services. In handling HTTP request, we pass all information between the server and client using JSON standard models. Each standard model is shown at the beginning of the sections below. This format adheres to the principles described in RESTful web-services.

  • Notebooks
    • List notebooks in root directory
    • Create new notebook
    • List notebooks in named directory
    • Open the named noteboko in subdirectory
    • Change notebook's standard model and save modified notebook
    • Delete a notebook in subdirectory
@Zsailer
Zsailer / reveal_problem_nb.ipynb
Last active August 29, 2015 14:13
Example notebook that caused problems in live reveal of Jupyter Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Creating an open source D3-Backbone app on Github

Github is where you'll host all your projects publically. It's the platform we'll use to write and share applications, and it allows us to work on these projects in parallel. It will make it easier for me to help you, since all your code is availabe for me to oversee online.

Getting started.

Navigate to the directory where you'd like to keep all your projects. The commands below will download the boilerplate code and prepare it for development. Anytime you see <project_name>, replace it with whatever name you're like to give the project (no spaces!).

git clone https://github.com/Zsailer/d3app 

Tasks for the day

  1. Read the introduction to D3.js here.
  2. Work through these tutorials:

Try to implement these bar charts directly in the d3app boilerplate code you've been using. Download a fresh project if you need here 3. Read about D3 transitions here.

@Zsailer
Zsailer / data.js
Last active August 29, 2015 14:27
metadata
// Metadata for networks and trajectories from the following paper:
// "Darwinian Evolution Can Follow Only Very Few Mutational Paths to Fitter Proteins"
// Weinreich, D., et.al
// http://www.sciencemag.org/content/312/5770/111.short
{
"directed": true,
"nodes": [
{
"value": 1.0152510120727598,
@Zsailer
Zsailer / template.tex
Last active November 19, 2015 00:44
Latex template for mathy paper supplement documents
%% Document type
\documentclass[12pt]{article}
%% Start of preamble
\usepackage{amsmath} % Advanced math extension
\usepackage{amssymb} % Advanced math symbols
\usepackage{array} % Advanced tables
%\usepackage{bm} % Allows bold greek letters in math mode
%\usepackage{caption} % Allows customization of caption appearance
\usepackage[margin=1in]{geometry} % Management of document margins and size
@Zsailer
Zsailer / prettify.py
Last active February 20, 2018 19:58
Make matplotlib plots pretty and standard
import matplotlib
def prettify(ax, legend_loc=4):
""" A simple wrapper to make matplotlib figures prettier."""
# Change default colors to something softer.
colors = {
'b': '#0066CC',
'r': '#CC0000',
'm': '#660066',