Skip to content

Instantly share code, notes, and snippets.

View riebschlager's full-sized avatar

Chris Riebschlager riebschlager

View GitHub Profile
@riebschlager
riebschlager / QUIZ.BAS
Created February 7, 2022 14:13
I wrote this when I was 15 in 1993. Evidently I was a snarky little cynic who hadn't yet perfected than/then.
5 CLS
10 PRINT "THIS PROGRAM HELPS WITH YOUR PROBLEMS"
15 PRINT
20 PRINT "NAME YOUR PROBLEM, IS IT"
25 PRINT
30 PRINT "A, MONEY; B, FAMILY; OR C, FRIENDS"
40 INPUT S$
50 IF S$ = "A" THEN 80
60 IF S$ = "B" THEN 160
70 IF S$ = "C" THEN 280
@riebschlager
riebschlager / td_json.py
Created February 11, 2019 04:52
Working with JSON in TouchDesigner
# me - this DAT.
#
# dat - the changed DAT
# rows - a list of row indices
# cols - a list of column indices
# cells - the list of cells that have changed content
# prev - the list of previous string contents of the changed cells
#
# Make sure the corresponding toggle is enabled in the DAT Execute DAT.
#
this.eventSearchObj = {
ObjectType: 'Event',
CvSearchObject: {
attributes: {
SearchType: 'AndSearch',
xmlns: 'http://schemas.cvent.com/api/2006-11'
},
Filter: [
{
Field: 'EventStartDate',
// The lighting controller expects a JSON-formatted array of lights states in the following format:
[
{
"lightId": Number,
"state": Boolean
}
];
// Sample usage: Turning on lights 1, 2 and 3. Turning off light 4.
const hotspots = [
{
name: 'Eglise Saint-Eustache',
x: 0,
y: 0,
images: ['eglise-saint-eustache-1.jpg', 'eglise-saint-eustache-2.jpg'],
dateConstructed: '1532-1632',
beforeNapoleon:
'Named after Saint Eustace, this Catholic Church has been used for traditional services since its construction, except during the Revolution when it was desecrated and looted.',
connectionToNapoleon:
{
"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,
# 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
#
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);
#!/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
#include <MPR121.h>
#include <Wire.h>
#define numElectrodes 6
void setup()
{
Serial.begin(9600);
while (!Serial);
Wire.begin();