Skip to content

Instantly share code, notes, and snippets.

View catchmrbharath's full-sized avatar

Bharath Mankalale catchmrbharath

View GitHub Profile
// add this to <profile>/static/custom/custom.js to load vim keybindings:
$.getScript("/static/components/codemirror/keymap/vim.js", function() {
if (! IPython.Cell) return;
IPython.Cell.options_default.cm_config.keyMap = "vim";
});
@catchmrbharath
catchmrbharath / pgessays.py
Created November 18, 2012 14:24 — forked from olasitarska/pgessays.py
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <ola@sitarska.com>
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
import re, ez_epub, urllib2, genshi
from IPython.frontend.qt.console.qtconsoleapp import IPythonQtConsoleApp
class MyApp(IPythonQtConsoleApp):
def init_config_files(self):
# override the place to look for builtin default config files
self.builtin_profile_dir = "custom"
super(MyApp, self).init_config_files()
def main():
import os
import shutil
from IPython.core.profiledir import ProfileDir, ProfileDirError
from IPython.utils.path import get_ipython_dir
pjoin = os.path.join
ipdir = get_ipython_dir()
# ensure IPython dir exists in case of first run: