Skip to content

Instantly share code, notes, and snippets.

@willingc
willingc / sphinx-version.py
Created January 5, 2016 00:43
Snippet from minrk to autopopulate version in Sphinx docs' conf.py file
# Project Jupyter uses the following to autopopulate version
_version_py = '../../jupyterhub/version.py'
version_ns = {}
exec(compile(open(_version_py).read(), _version_py, 'exec'), version_ns)
# The short X.Y version.
version = '%i.%i' % version_ns['version_info'][:2]
# The full version, including alpha/beta/rc tags.
release = version_ns['__version__']
import nbformat
from nbformat.v4 import new_code_cell,new_notebook
import codecs
sourceFile = "changeMe.py" # <<<< change
destFile = "changeMe.ipynb" # <<<< change
def parsePy(fn):
@willingc
willingc / api.yaml
Created February 15, 2016 04:26
swagger api for testing
swagger: '2.0'
info:
title: Jupyter Notebook API
description: Notebook API
version: "5"
contact:
name: Jupyter Project
url: jupyter.org
# will be prefixed to all paths
basePath: /api
@willingc
willingc / pgenvtest.txt
Created March 31, 2016 17:36
Checking postgres
SELECT name, setting
FROM pg_settings
WHERE category = 'File Locations';
Blog post on sys path http://mikeboers.com/blog/2014/05/23/where-does-the-sys-path-start
Talk by Carl Meyers http://pyvideo.org/video/389/pycon-2011--reverse-engineering-ian-bicking--39-s
@willingc
willingc / jupnb.md
Last active April 12, 2016 01:55
Notebook issue searches
@willingc
willingc / testmerge.ipynb
Last active July 12, 2016 11:13
Test notebook for cell merging
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willingc
willingc / index_django_docs_to_elasticsearch.py
Created August 21, 2016 17:34 — forked from simonw/index_django_docs_to_elasticsearch.py
Example code for converting Django docs into a format suitable for import into Elasticsearch - for a talk I'm giving.
#!/usr/bin/env python
import re
import os
import urlparse
import hashlib
import json
import sys
title_re = re.compile(r'([=*]{3,})\n([^\n]+)\n\1\n')
@willingc
willingc / jupyterdocs.md
Last active August 30, 2016 16:30
Documentation creation resources for Jupyter, JupyterHub, IPython