Skip to content

Instantly share code, notes, and snippets.

View minrk's full-sized avatar

Min RK minrk

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Configuration file for ipython-qtconsole.
# example ipython_qtconsole_config.py for preserving kernel cwd across restarts
# Author: Min RK
# License: Public Domain
from IPython.utils.process import getoutput
from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp
from IPython.qt.manager import QtKernelManager
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Week_1_Finite_differences</title>
<style type="text/css">
.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}
.clearfix:after{clear:both}
"""Interact with functions using widgets."""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
@minrk
minrk / nbsplit
Created February 11, 2014 22:35
#!/usr/bin/env python
"""
Usage: nbsplit notebook.ipynb [other_notebooks.ipynb]
Script for splitting IPython notebooks based on heading level 1 cells.
Just add heading 1 wherever you want your notebook to be split.
Author: Min RK (@minrk)
License: Public Domain
{%- extends 'full.tpl' -%}
{% block data_png %}
<img src="data:image/png;base64,{{ output.png }}"
{%- if 'width' in output.metadata.get('png', {}) %}
width={{output.metadata['png']['width']}}
{%- endif %}
{%- if 'height' in output.metadata.get('png', {}) %}
height={{output.metadata['png']['height']}}
{%- endif %}
>
From 5deb1504dab0b60de9373c8432dac2fd7d0b0032 Mon Sep 17 00:00:00 2001
From: MinRK <benjaminrk@gmail.com>
Date: Thu, 20 Feb 2014 15:33:36 -0800
Subject: [PATCH] log elements removed when unrecognized
---
src/com/google/caja/plugin/html-sanitizer.js | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/com/google/caja/plugin/html-sanitizer.js b/src/com/google/caja/plugin/html-sanitizer.js
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# auto-restart ipengine if it exits uncleanly
while true; do
ipengine && break
done
# create mapping of engine_id : hostname
import socket
host_map = rc[:].apply_async(socket.gethostname).get_dict()
# reverse the mapping to hostname : [eid, eid2, ...]
host_map_r = {}
for eid, host in host_map.items():
host_map_r.setdefault(host, [])