Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Mike DePalatis mivade

👋
View GitHub Profile
@mivade
mivade / #zmqcpp-raw-README.md
Last active Apr 12, 2017
Sending raw bytes over ZMQ sockets with C++
View #zmqcpp-raw-README.md

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 / cli.py
Last active May 17, 2021
Using a decorator to simplify subcommand creation with argparse
View cli.py
from argparse import ArgumentParser
cli = ArgumentParser()
subparsers = cli.add_subparsers(dest="subcommand")
def argument(*name_or_flags, **kwargs):
"""Convenience function to properly format arguments to pass to the
subcommand decorator.
@mivade
mivade / slides.md
Created Sep 14, 2016 — forked from aaronwolen/slides.md
Pandoc template to generate reveal.js slideshows.
View slides.md

% Title % Name % Date

My first slide

List

@mivade
mivade / app.py
Last active Jun 30, 2019
Websockets with Flask via aiohttp
View app.py
"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's
WSGIHandler.
"""
import asyncio
from aiohttp import web
from aiohttp_wsgi import WSGIHandler
from flask import Flask, render_template
View #pygal-canvas-README.md

Testing using Pygal to render plots server-side and embed them in a web page via a <canvas>.

View #react-chartjs-README.md

react-chartjs tests

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

@mivade
mivade / bokehnado.py
Created Oct 25, 2015
Update Bokeh plots without using the bokeh-server
View bokehnado.py
"""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
View tmux.md

tmux notes

Reattaching when verisons don't match

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

#$^#^# what now?? Aha...
@mivade
mivade / #tornado-websocket-pubsub.rst
Last active Jul 5, 2019
Using Tornado websockets for the publish/subscribe pattern
@mivade
mivade / hg_importing.md
Last active Mar 6, 2019
How to import history from one Mercurial repository into another
View hg_importing.md

Importing a Mercurial repository's full history into another repository

Convert the soon-to-be child repository

With the Mercurial convert extention, you can rename branches, move, and filter files. As an example, say we have a repo with only the default branch which is to be imported into a super-repository.

For starters, we will want all our files in the child repo to be in a subdirectory of the parent repo and not include the child's