Skip to content

Instantly share code, notes, and snippets.

View jasongrout's full-sized avatar

Jason Grout jasongrout

View GitHub Profile
* b69B80Oo
* 1Il|
* ij
* 5S
* 9gq
* co
* rn m
* cl d
* vv w
* .,
diff --git a/packages/console-extension/schema/tracker.json b/packages/console-extension/schema/tracker.json
index b57152070..5cd7fe206 100644
--- a/packages/console-extension/schema/tracker.json
+++ b/packages/console-extension/schema/tracker.json
@@ -13,7 +13,16 @@
"selector": ".jp-CodeConsole-promptCell"
}
],
- "properties": {},
+ "jupyter.lab.transform": true,
import sys
import json
import os
import collections
pkgs = {}
for f in os.listdir(os.path.join(sys.prefix, 'conda-meta')):
path = os.path.join(sys.prefix, 'conda-meta', f)
if path.endswith('.json'):
with open(path) as fp:
@jasongrout
jasongrout / example.py
Created October 11, 2012 22:12 — forked from mdboom/serve_figure.py
Proof of concept code for serving interactive matplotlib figures to the webbrowser
import serve_figure
import numpy as np
from numpy import ma
from matplotlib import pyplot as plt
n = 12
x = np.linspace(-1.5,1.5,n)
y = np.linspace(-1.5,1.5,n*2)
const WebSocket = require('ws');
const patchDB = new Map();
numStores = 0;
const wss = new WebSocket.Server({ port: 8081 });
function storeId(msg) {
return {
msgType: 'storeid-reply',
@jasongrout
jasongrout / esIterTest.js
Last active April 26, 2018 15:58 — forked from sccolbert/esIterTest.js
Undefined compare slow in Firefox
// Interestingly, the compare with undefined below is about ~10x slower than the typeof compare in Firefox.
// See this by running myTiming() and myTimingUndefinedCompare()
class MyArrayIterator {
constructor(source) {
this._index = 0;
this._source = source;
}

Slides

JupyterLab update

JupyterLab is a new web-based frontend that brings together many tools in an extensible, performant, open-source environment. We announced it to be ready for users about a month ago. We are calling it "beta" since the extension developer APIs for making extensions are still evolving.

JupyterLab

This is JupyterLab. Create a new tab by clicking the + button or using the File | New menu. We can then start a notebook with a specific kernel, a console, terminal, or text editor.

diff --git a/docs/source/examples/Widget Styling.ipynb b/docs/source/examples/Widget Styling.ipynb
index 0ac7a28d..70963f81 100644
--- a/docs/source/examples/Widget Styling.ipynb
+++ b/docs/source/examples/Widget Styling.ipynb
@@ -534,8 +534,7 @@
"source": [
"from ipywidgets import Layout, Button, Box\n",
"\n",
- "items_layout = Layout(flex='1 1 auto',\n",
- " width='auto') # override the default width of the button to 'auto' to let the button grow\n",
function loop_test(data, start, trials) {
const CH_DELIMITER = ','.charCodeAt(0);
const CH_LF = 10; // \n
const CH_CR = 13; // \r
let loop_char;
let loop_i;
for (let c = 0; c<trials; c++) {
loop_i = start;
while (loop_i < 1000-2) {
loop_char = data.charCodeAt(loop_i);
@jasongrout
jasongrout / index.html
Created March 3, 2018 04:54
Benchmarking loops vs regex
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<pre id="output"></div>
<script>
const regex = new RegExp(`[,\n\r]`, 'g');
const simpletrials = 10000000;
const out = document.getElementById('output');