Skip to content

Instantly share code, notes, and snippets.

@blink1073
blink1073 / qgrid_ipython.ipynb
Last active February 4, 2016 11:22
QGrid IPython Widget
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / api.yaml
Last active August 4, 2017 07:27
Jupyter REST API
swagger: '2.0'
info:
title: Jupyter Notebook API
description: Notebook API
version: "4"
contact:
name: Jupyter Project
url: jupyter.org
# will be prefixed to all paths
basePath: /api
@blink1073
blink1073 / metatlas_bokeh.ipynb
Created July 31, 2015 02:38
Metatlas Bokeh Test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / pygments_completion.py
Last active August 29, 2015 14:26
Token Completions Using Pygments
from pygments.lexers import get_lexer_for_filename
from pygments.token import Token
def get_matches(code, filename):
"""Get token-based matches for the current context in a file.
"""
lexer = get_lexer_for_filename(filename)
tokens = [i for i in lexer.get_tokens(code)]
@blink1073
blink1073 / nersc_ipython.md
Last active August 29, 2015 14:25
IPython at Nersc Setup

Log in to https://ipython.nersc.gov/. Run the following in a notebook cell to get set up (note this only has to be done once for a given user):

%%file ~/.ipython/profile_default/startup/ipython_config.py
import sys
sys.path.insert(0, '/project/projectdirs/metatlas/python_pkgs/')
import os
os.environ['R_LIBS_USER'] = '/project/projectdirs/metatlas/r_pkgs/'
@blink1073
blink1073 / mpl_widget.ipynb
Last active August 29, 2015 14:24
Matplotlib Widget for IPython 3.2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / mpld3_custom_widget.ipynb
Last active August 29, 2015 14:24
Mpld3 IPython Widget for IPython 3.2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / myqtgraph.py
Created May 8, 2015 20:21
PyQtGraph Simplified Gui Maker
import pickle
import pyqtgraph as pg
from pyqtgraph.parametertree import Parameter, ParameterTree
from pyqtgraph.parametertree.parameterTypes import (
WidgetParameterItem, registerParameterType)
from pyqtgraph.Qt import QtGui, QtCore
def tree(name, params):
@blink1073
blink1073 / qt_key_shortcut_editor.py
Last active March 4, 2020 16:57
Qt Keyboard Shortcut Editor
import sys
from PyQt4 import QtGui, QtCore
import warnings
class KeySequenceEdit(QtGui.QLineEdit):
"""
This class is mainly inspired by
http://stackoverflow.com/a/6665017