Skip to content

Instantly share code, notes, and snippets.

@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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blink1073
blink1073 / mockXHR.ts
Created August 18, 2015 20:01
Mock XHR
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// Mock implementation of XMLHttpRequest following
// https://developer.mozilla.org/en-US/docs/Web/API/xmlhttprequest
import expect = require('expect.js');
@blink1073
blink1073 / faux-jax.d.ts
Last active August 29, 2015 14:27
Node Ajax tester
// Type definitions for faux-jax
// Project: https://github.com/algolia/faux-jax
declare module 'faux-jax' {
export function install(): void;
export function on(type: string, cb: (xhr: any) => void): void;
export function waitFor(nbRequests: number, cb: () => void): void;
export function restore(): void;
}
@blink1073
blink1073 / qgrid_ipython.ipynb
Last active February 4, 2016 11:22
QGrid IPython Widget
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.