Skip to content

Instantly share code, notes, and snippets.

View riebschlager's full-sized avatar

Chris Riebschlager riebschlager

View GitHub Profile
var colors = [0x96cb79, 0x94ca7b, 0x92ca7d, 0x90c97e, 0x8ec980, 0x8cc882, 0x8ac884, 0x88c785, 0x86c787, 0x84c689, 0x82c58a, 0x80c58c, 0x7ec48e, 0x7bc48f, 0x79c391, 0x76c393, 0x74c294, 0x71c296, 0x6fc198, 0x6cc099, 0x69c09b, 0x66bf9d, 0x63bf9e, 0x60bea0, 0x5dbea2, 0x5abda3, 0x56bda5, 0x53bca6, 0x4fbca8, 0x4abbaa, 0x46bbab, 0x41baad, 0x3cbaae, 0x36b9b0, 0x43baad, 0x4ebbaa, 0x57bda7, 0x5fbea4, 0x67bfa1, 0x6ec09e, 0x74c19b, 0x7ac398, 0x80c495, 0x86c592, 0x8bc68f, 0x90c78c, 0x95c989, 0x9aca86, 0x9fcb83, 0xa3cc7f, 0xa8cd7c, 0xaccf79, 0xb0d075, 0xb4d172, 0xb8d26e, 0xbcd36b, 0xc0d567, 0xc4d663, 0xc8d75f, 0xccd85b, 0xd0da57, 0xd3db53, 0xd7dc4f, 0xdadd4a, 0xdedf45, 0xe2e040, 0xe5e13a, 0xe5de3a, 0xe4db3a, 0xe4d83a, 0xe3d53a, 0xe3d23a, 0xe2cf3a, 0xe2cd3a, 0xe2ca39, 0xe1c739, 0xe0c439, 0xe0c139, 0xdfbe39, 0xdfbb39, 0xdeb839, 0xdeb539, 0xddb238, 0xddaf38, 0xdcac38, 0xdbaa38, 0xdba738, 0xdaa438, 0xd9a137, 0xd99e37, 0xd89b37, 0xd79837, 0xd69537, 0xd69236, 0xd58f36, 0xd48c36, 0xd38936, 0xd38635, 0xd28335, 0xd18035];
const MO
#!/bin/bash
MOVIES=~/locker_attract
find "$MOVIES" -name '*.mov' -exec sh -c 'ffmpeg -loglevel quiet -stats -i "$0" -deadline best -qmax 15 -crf 5 -b:v 15M -strict -2 "${0%%.mov}.webm"' {} \;
exit;
find . -name '*.tif' -exec sh -c 'convert "$0" -format jpg -quality 80 -set colorspace RGB -colorspace sRGB -flatten -density 72 -resize 1080x1080 "${0%%.tif}.jpg"' {} \;
function Util() {}
Util.prototype.map = function(input, oldMin, oldMax, newMin, newMax) {
return ((input - oldMin) / (oldMax - oldMin)) * (newMax - newMin) + newMin;
};
Util.prototype.random = function(min, max) {
var rand = Math.random();
if (arguments.length === 0) {
return rand;
// Double-check that these pins are correct.
const int sensorPin = 9;
const int relayPin = 10;
const int threshold = 50;
void setup() {
Serial.begin(9600);
pinMode(sensorPin, INPUT);
pinMode(relayPin, OUTPUT);
const int sensorPin = 9; // PW socket on sensor board
const int relayPin = 10; //
const int threshold = 48; //
const bool DEBUG = false;
int ticks = 0;
void setup() {
Serial.begin(9600);
#include <MPR121.h>
#include <Wire.h>
#define numElectrodes 6
void setup()
{
Serial.begin(9600);
while (!Serial);
Wire.begin();
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
from pygame.locals import *
import os
import pygame
import random
import serial
let ids = [];
const fs = require('fs');
if(!String.prototype.padStart) {
String.prototype.padStart = function padStart(targetLength, padString) {
targetLength = targetLength >> 0;
padString = String(padString || ' ');
if(this.length > targetLength) {
return String(this);
# csv2json.py
#
# Copyright 2009 Brian Gershon -- briang at webcollective.coop
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
{
"editor.fontFamily": "DejaVu Sans Mono",
"workbench.colorTheme":"Default Dark+",
"prettier.tabWidth": 4,
"prettier.singleQuote": true,
"editor.wordWrapColumn": 0,
"editor.minimap.enabled": false,
"git.enableSmartCommit": true,
"git.autofetch": true,
"explorer.confirmDelete": false,