Skip to content

Instantly share code, notes, and snippets.

import subprocess
import time
import select
import sys
def stream_procs(procs, poll_interval_ms=100, timeout_ms=None):
"""
yields output for all processes until they're all finished
import subprocess
import time
from queue import Queue, Empty
from threading import Thread
import sys
def _enqueue_output(out, queue):
for line in iter(out.readline, b''):
queue.put(line)
@ymmn
ymmn / promises.js
Created April 29, 2017 04:25
implementing promises from scratch
/**
* Implementing promises from scratch. Turns out simple
*
* There are only two possibilities:
* 1. then() gets called before the async function finishes
* 2. then() gets called after the async function finishes
*
* as long as we handle both, we're good!
*/
# encrypt
openssl enc -aes-256-cbc -in un_encrypted.data -out encrypted.data
# decrypt
openssl enc -d -aes-256-cbc -in encrypted.data -out un_encrypted.data
from multiprocessing import Process, Queue
import time
import os
def worker(q, output_q):
while True:
print 'im the worker', os.getpid()
print 'got ', q.get()
output_q.put(55)
@ymmn
ymmn / web-basics.md
Last active January 26, 2017 18:54
for the "Web Stuff" beginner's club talk

Internet vs Web

Main things about the web: hypertext and URLs

Core Web Technologies

  • Hypertext Markup Language (HTML)
  • Hypertext Transfer Protocol (HTTP)
  • Web browsers

This is everything we had back in 1994.