Skip to content

Instantly share code, notes, and snippets.

@blink1073
blink1073 / create_package.sh
Last active March 16, 2017 11:13
JupyterLab Big Split Utilities
if [ "$#" -ne 1 ]; then
echo "Specify the target"
fi
# copy default files
cp tsconfig.json $1
cp package.json $1
cd $1
# make source and optionally style directories
mkdir src
git mv *.ts src
@blink1073
blink1073 / concrete_interfaces.ts
Last active February 23, 2017 11:38
JupyterLab models
interface ISignal<T, U> { };
interface ITextSelection { };
interface JSONValue { };
interface JSONObject { };
interface IMap<T> extends Map<string, T> { };
interface JSONMap extends IMap<JSONValue> { };
// Editor
@blink1073
blink1073 / editor_interface.ts
Created October 21, 2016 21:40
An editor interface for JupyterLab
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import {
IDisposable
} from 'phosphor/lib/core/disposable';
import {
Message
} from 'phosphor/lib/core/messaging';
@blink1073
blink1073 / createsession.ts
Last active June 2, 2016 19:12
Create a session for a notebook
import {
INotebookSession, IKernelSpecIds, ContentsManager, startNewSession,
getKernelSpecs
} from 'jupyter-js-services';
/**
* Fetch notebook contents by path.
*/
@blink1073
blink1073 / plugin_manager.py
Last active January 10, 2016 02:06
Spyder QProcess
# -*- coding: utf-8 -*-
#
# Copyright © 2016 The Spyder development team
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
import socket
import errno
import os
import sys
@blink1073
blink1073 / kernelfuture.ts
Last active September 15, 2015 19:48
KernelFuture
/**
* Implementation of a kernel future.
*/
class KernelFutureHandler implements IKernelFuture {
constructor(kernel: IKernel, msgId: string, shellPromise: Promise<IKernelMessage>) {
this._msgId = msgId;
this.autoDispose = false;
this._kernel = kernel;
@blink1073
blink1073 / actions.ts
Last active August 26, 2015 12:47
Keyboard Manager
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
* A bunch of predefined `Simple Actions` used by Jupyter.
* `Simple Actions` have the following keys:
* help (optional): a short string the describe the action.
* will be used in various context, like as menu name, tool tips on buttons,
* and short description in help menu.
* help_index (optional): a string used to sort action in help menu.
@blink1073
blink1073 / services.ts
Last active August 29, 2015 14:28
Services Base Class
class Service {
constructor() {
this._onReady = new Promise<void>((resolve, reject) => {
this._finishInit = resolve;
});
}
/**
* Promise fullfilled when the object is initialized.
@blink1073
blink1073 / qgrid_export.ipynb
Last active August 29, 2015 14:28
qgrid_export2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / qgrid_export.ipynb
Last active August 29, 2015 14:28
QGrid Export
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.