Skip to content

Instantly share code, notes, and snippets.

View NormanEdance's full-sized avatar
Life cannot just be about solving one sad problem after another.

Norman E. NormanEdance

Life cannot just be about solving one sad problem after another.
  • Astana, Kazakhstan
  • 23:17 (UTC +05:00)
View GitHub Profile
NormanEdance /
Created March 13, 2018 05:47 — forked from nvgoldin/
Python 3.5 asyncio - shutdown all tasks safely using signal handler
import signal
import functools
async def looping_task(loop, task_num):
while True:
print('{0}:in looping_task'.format(task_num))
await asyncio.sleep(5.0, loop=loop)
except asyncio.CancelledError:
return "{0}: I was cancelled!".format(task_num)
NormanEdance / cubism-websockets.html
Created February 20, 2018 04:45 — forked from cuadue/cubism-websockets.html
Streaming data to cubism.js with websockets
<!DOCTYPE html>
<meta charset='utf-8'>
<title>Cubism + Websockets</title>
<script language='javascript' src='d3.min.js'></script>
<script language='javascript' src='cubism.v1.js'></script>
<script language='javascript'>
/* I can never seem to remember:
Array.push() appends to the end, and returns the new length
NormanEdance /
Created February 12, 2018 05:05 — forked from DGrady/
Stream data asynchronously through a subprocess in Python
Problem: provide two-way communication with a subprocess in Python.
See also:
import asyncio
import sys