Skip to content

Instantly share code, notes, and snippets.

View scottjanousek's full-sized avatar

Scott Janousek scottjanousek

View GitHub Profile
@tgfrerer
tgfrerer / pollkeys.cpp
Created April 17, 2014 18:00
how to poll keys from a windows openFrameworks console window
void ofApp::pollKeys(){
HANDLE hStdInput = GetStdHandle(STD_INPUT_HANDLE);
DWORD events = 0; // how many events took place
INPUT_RECORD input_record; // a record of input events
DWORD input_size = 1; // how many characters to read
// we use peek so that this is non-blocking.
BOOL peek = PeekConsoleInput(hStdInput, &input_record, input_size, &events);
@pingswept
pingswept / server.py
Last active May 5, 2023 22:45
Code for Color Commons project on Greenway Light Blades in Boston. The real code starts around line 808; the rest is mostly boilerplate and data.
from flask import Flask, render_template, request
from uwsgidecorators import *
import pytronics
import os, time
public = Flask(__name__)
public.config['PROPAGATE_EXCEPTIONS'] = True
# Include "no-cache" header in all POST responses
@public.after_request