Skip to content

Instantly share code, notes, and snippets.

@blink1073
blink1073 / start_jupyter_server.js
Last active Apr 25, 2020
Start a JupyterLab Server in Node
View start_jupyter_server.js
const child = require('child_process').spawn('jupyter-notebook', ['--no-browser']);
const PageConfig = require('@jupyterlab/coreutils').PageConfig;
const PromiseDelegate = require('@lumino/coreutils').PromiseDelegate;
const delegate = new PromiseDelegate();
async function main() {
View phantom_3d.py
from __future__ import division
import numpy as np
def phantom3d(phantom='modified-shepp-logan', n=64):
"""Three-dimensional Shepp-Logan phantom
Can be used to test 3-D reconstruction algorithms.
Parameters
@blink1073
blink1073 / qt_key_shortcut_editor.py
Last active Mar 4, 2020
Qt Keyboard Shortcut Editor
View qt_key_shortcut_editor.py
import sys
from PyQt4 import QtGui, QtCore
import warnings
class KeySequenceEdit(QtGui.QLineEdit):
"""
This class is mainly inspired by
http://stackoverflow.com/a/6665017
@blink1073
blink1073 / index.ts
Last active Nov 2, 2019
property inspector
View index.ts
import {
JupyterFrontEnd, JupyterFrontEndPlugin, ILabShell
} from '@jupyterlab/application';
import {
MainAreaWidget, ReactWidget
} from '@jupyterlab/apputils';
import {
Token
@blink1073
blink1073 / Backup Notes.md
Last active Oct 4, 2019
Jupyter Enterprise JEP (Draft)
View Backup Notes.md

When submitting an enhancement proposal, individuals will include the following information in their submission.

The problem that this enhancement addresses. If possible include code or anecdotes to describe this problem to readers.

A brief (1-2 sentences) overview of the enhancement you are proposing. If possible include hypothetical code sample to describe how the solution would work to readers.

A detailed explanation covering relevant algorithms, data structures, an API spec, and any other relevant technical information
A list of pros that this implementation has over other potential implementations.
A list of cons that this implementation has.
@blink1073
blink1073 / pexpect.py
Last active Aug 27, 2019
Simple cross platform version of pexpect
View pexpect.py
'''Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be used for automated software testing. Pexpect is in the spirit of Don
Libes' Expect, but Pexpect is pure Python. Other Expect-like modules for Python
require TCL and Expect or require C extensions to be compiled. Pexpect does not
use C, Expect, or TCL extensions. It should work on any platform that supports
the standard Python pty module. The Pexpect interface focuses on ease of use so
that simple tasks are easy.
View keybase.json
### Keybase proof
I hereby claim:
* I am blink1073 on github.
* I am blink1073 (https://keybase.io/blink1073) on keybase.
* I have a public key ASCDyw9ILX4MYwb0QEz0FoJCY3PcM49VZGetMmdcf3RsOAo
To claim this, I am signing this object:
@blink1073
blink1073 / plotting.ipynb
Created May 3, 2019
Octave Kernel Plotting
View plotting.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / dict_to_table.py
Last active Aug 20, 2018
Dict to PyTables Store
View dict_to_table.py
"""
Given an arbitrarily nested dictionary, create a PyTables Table
Populate a table row given the contents of a dictionary
"""
import tables
import numpy as np
import sys
@blink1073
blink1073 / selection_widgets.py
Last active Jun 18, 2018
Improved RectangleSelector and LassoSelector and new EllipseSelector, PaintSelector and LineSelector widgets.
View selection_widgets.py
import numpy as np
from matplotlib.widgets import AxesWidget
from matplotlib.patches import Rectangle, Ellipse
from matplotlib.lines import Line2D
import matplotlib.colors as mcolors
from matplotlib.transforms import blended_transform_factory
LABELS_CMAP = mcolors.ListedColormap(['white', 'red', 'dodgerblue', 'gold',
'greenyellow', 'blueviolet'])
You can’t perform that action at this time.