Skip to content

Instantly share code, notes, and snippets.

jeremyblow /
Last active Sep 27, 2020
Convert Dreem CSV to OSCAR-friendly Zeo CSV
"""Convert Dreem CSV to OSCAR-friendly Zeo CSV
Liberty taken with the ZQ column, pinning it to 0. Other non-common fields are nulled.
Tested with Python 3.7.3 and 2.7.10.
python data_in.csv data_out.csv
from csv import DictReader, DictWriter
from datetime import datetime, timedelta
jeremyblow /
Created Jul 17, 2018
Fun things for Dabeaz's superbad superboard
"""Fun things for Dabeaz's superbad superboard.
Default Audio Format:
Frame rate: 48kHz
Channels: 1
Bytes per sample: 1
Superboard Encoding:
Baud rate: 300
jeremyblow / main.c
Last active Jun 16, 2018
ATmega328p 20kHz PWM for control of Delta THB1748BG
View main.c
void setup() {
// Core clock runs at 16MHz, three different timers can divide this freq
// by using a prescalar factor. Different PWM modes are available for each
// timer. We are using Fast PWM, which has the counter count from 0 to TOP.
// Thus, timer frequency would be 16MHz / prescalar / TOP count. The output
// turns on when the timer is at 0, and turns off when reaches the compare
// register value. As the compare register approaches TOP, the duty cycle
// approaches 100%. Since 0 is included in the high state, the effective
// counts in the high state will be the register value + 1.
jeremyblow / 0_reuse_code.js
Created Apr 9, 2016
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
jeremyblow / gist:7060658
Last active Dec 25, 2015
Mavis Bacon.. mmm.. bacon.
View gist:7060658
import urllib2
import random
import difflib
import datetime
def fetch(url):
"""Fetches requested url, returns lines in list"""
response = urllib2.urlopen(url)
lines = response.readlines()
return lines
jeremyblow /
Last active Dec 22, 2015
Polls Natural Selection 2 API for game status, allows bidirectional chat, and server commands.
Project now resides as GitHub repo here:
View gist:5733394
Files needed: