Skip to content

Instantly share code, notes, and snippets.

View mivade's full-sized avatar
👋

Mike DePalatis mivade

👋
View GitHub Profile
@mivade
mivade / bokehnado.py
Created October 25, 2015 12:34
Update Bokeh plots without using the bokeh-server
"""Demonstration of using Tornado to send updates to a Bokeh plot
without using the bokeh-server.
"""
import json
import numpy.random as npr
from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.web import Application, RequestHandler
@mivade
mivade / coroutinify.py
Created August 3, 2015 17:53
Adapting blocking calls to Tornado coroutines with run_on_executor decorators
import random
import time
from tornado import gen
from tornado.concurrent import run_on_executor, futures
from tornado.ioloop import IOLoop
class TaskRunner(object):
def __init__(self, loop=None):
self.executor = futures.ThreadPoolExecutor(4)
self.loop = loop or IOLoop.instance()

Keybase proof

I hereby claim:

  • I am mivade on github.
  • I am mivade (https://keybase.io/mivade) on keybase.
  • I have a public key ASCjifbgjSNGV_4F5Ge6JtJZBHGMNpi4miYvMDbZUbD1Fwo

To claim this, I am signing this object:

@mivade
mivade / randport.py
Created May 12, 2017 17:49
Binding to random ports for IPC
"""Examples of how to bind a socket to a random port and have that port number
accessible to other processes. Useful for interprocess communications.
"""
import time
import socket
from socket import AF_INET, SOCK_STREAM
from multiprocessing import Process, Queue, Event
from contextlib import contextmanager
@mivade
mivade / #zmqcpp-raw-README.md
Last active April 12, 2017 01:33
Sending raw bytes over ZMQ sockets with C++

Demo of sending raw bytes over ZMQ sockets with C++.

This assumes you are using miniconda and have installed cppzmq:

conda install -c conda-forge cppzmq
@mivade
mivade / slides.md
Created September 14, 2016 12:49 — forked from aaronwolen/slides.md
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@mivade
mivade / pyqtornado.py
Last active April 11, 2016 03:18
PyQt with Tornado
"""Demonstration of combining the Qt and Tornado event loops."""
from PyQt4 import QtGui, QtCore
from tornado.ioloop import IOLoop
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
URL = "https://www.random.org/integers/?num=1&min=100&max=999&col=1&base=10&format=plain&rnd=new"
class MainWindow(QtGui.QMainWindow):
@mivade
mivade / #react-chartjs-README.md
Last active January 3, 2016 14:27
react-chartjs

react-chartjs tests

Nothing special, just playing around with react-chartjs and jspm.

Locations for Gnome settings:

~/.gconf
~/.local/share/gnome-shell
~/.config/dconf

Probably don't want to copy over ~/.local/share/gnome-shell/application_state.

@mivade
mivade / tmux.md
Created October 16, 2015 11:43
tmux notes

tmux notes

Reattaching when verisons don't match

$ tmux attach
protocol version mismatch (client 7, server 6)

#$^#^# what now?? Aha...