Skip to content

Instantly share code, notes, and snippets.

wynsmart /
Last active May 17, 2020
AsyncIO Task Scheduler
#!/usr/bin/env python3
import asyncio
from typing import Coroutine, List
class AsyncScheduler:
def run(cls, tasks: List[Coroutine], limit: int = 3) -> None:
wynsmart /
Last active Apr 24, 2019
Subprocess Scheduler
import typing
import subprocess
import time
import logging
class ProcessConfig(typing.NamedTuple):
cmd: typing.Any # cmd to run
stdin: typing.IO = None
stdout: typing.IO = None
wynsmart /
Created Jan 18, 2017
colored terminal prints
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
wynsmart / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console