Skip to content

Instantly share code, notes, and snippets.

@sccolbert
sccolbert / gist:8569752
Created January 22, 2014 23:33
Simple threads with Enaml
from threading import Thread
from time import sleep
from atom.api import Atom, Bool, Int
from enaml.application import deferred_call
from enaml.widgets.api import Window, Container, ProgressBar, PushButton
class Model(Atom):
class MyGridStackContainer extends Widget {
constructor(options: GridStackOptions) {
$(this.node).gridstack(options)
}
protected onChildAdded(msg: ChildMessage): void {
msg.child.addClass('grid-stack-item');
}
@sccolbert
sccolbert / kernelfuture.ts
Last active September 15, 2015 19:55 — forked from blink1073/kernelfuture.ts
KernelFuture
function createFuture(kernel: IKernel, msgId: string, shellPromise: Promise<IKernelMessage>): IKernelFuture {
var future = new KernelFutureHandler(msgId);
kernel.iopubReceived.connect(future.handleIOPub, future);
kernel.stdinReceived.connect(future.handlerStdin, future);
shellPromise.then(msg => future.handleReply(kernel, msg));
return future;
}
[traitletsargs] C:\Users\Chris\Development>python -m nbconvert.__main__ "0 - nam
e.ipynb" --to slides --post serve
[NbConvertApp] Converting notebook 0 - name.ipynb to slides
Traceback (most recent call last):
File "C:\Anaconda\envs\traitletsargs\lib\runpy.py", line 162, in _run_module_a
s_main
"__main__", fname, loader, pkg_name)
File "C:\Anaconda\envs\traitletsargs\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Anaconda\envs\traitletsargs\lib\site-packages\nbconvert\__main__.py",
[traitletsargs] C:\Users\Chris\Development>python -m jupyter_core.command nbcon
ert "0 - name.ipynb" --to slides --post serve
[traitletsargs] C:\Users\Chris\Development>This application is used to convert
otebook files (*.ipynb) to various other
formats.
WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.
Ss-MacBook-Pro:phosphorjs Chris$ mkdir foo
Ss-MacBook-Pro:phosphorjs Chris$ cd foo
Ss-MacBook-Pro:foo Chris$ npm install phosphor-gridpanel
|
> [email protected] postinstall /Users/Chris/Development/phosphorjs/foo/node_modules/phosphor-gridpanel/node_modules/phosphor-widget
> npm dedupe
> [email protected] postinstall /Users/Chris/Development/phosphorjs/foo/node_modules/phosphor-gridpanel
> npm dedupe
Ss-MacBook-Pro:phosphorjs Chris$ mkdir foo
Ss-MacBook-Pro:phosphorjs Chris$ cd foo
Ss-MacBook-Pro:foo Chris$ git clone https://github.com/phosphorjs/phosphor-gridpanel.git
Cloning into 'phosphor-gridpanel'...
remote: Counting objects: 87, done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 87 (delta 20), reused 87 (delta 20), pack-reused 0
Unpacking objects: 100% (87/87), done.
Checking connectivity... done.
Ss-MacBook-Pro:foo Chris$ cd phosphor-gridpanel/
collections
-----------
phosphor-arrays
phosphor-queue
phosphor-sectionlist
core
----
phosphor-disposable
phosphor-messaging
interface ISignal {
_ISignalStructuralProperty: void;
}
interface ISignal1<T1> {
_ISignal1StructuralPropertyT1: T1;
}
interface ISlot<T, U> {
(sender: T, args: U): void;
}
class Signal<T, U> {
connect(slot: ISlot<T, U>): void {
}