Skip to content

Instantly share code, notes, and snippets.

View gregyjames's full-sized avatar
:octocat:
Available

Greg gregyjames

:octocat:
Available
View GitHub Profile
@gregyjames
gregyjames / pipeline.py
Created July 31, 2020 13:22 — forked from sampsyo/pipeline.py
multithreaded pipelines for Python coroutines
"""Simple but robust implementation of generator/coroutine-based
pipelines in Python. The pipelines may be run either sequentially
(single-threaded) or in parallel (one thread per pipeline stage).
This implementation supports pipeline bubbles (indications that the
processing for a certain item should abort). To use them, yield the
BUBBLE constant from any stage coroutine except the last.
In the parallel case, the implementation transparently handles thread
shutdown when the processing is complete and when a stage raises an
@gregyjames
gregyjames / queue.cpp
Created July 9, 2018 08:28 — forked from sudheesh001/queue.cpp
C++ implementation of queue
#include <iostream>
using namespace std;
template <class etype>
class queue
{
class qnode
{
public:
etype element;
@gregyjames
gregyjames / midi.ino
Last active June 22, 2018 08:19 — forked from arion/midi.ino
Arduino Launchpad
#include <MIDI.h>
#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>
#include <math.h>
SoftwareSerial mySerial(11, 10); // RX, TX
MIDI_CREATE_DEFAULT_INSTANCE();
bool isMp3Mode = false;
#include <MIDI.h>
#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>
#include <math.h>
SoftwareSerial mySerial(11, 10); // RX, TX
MIDI_CREATE_DEFAULT_INSTANCE();
bool isMp3Mode = false;