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
import urllib2
import json
import csv
def write_to_csv(url):
response = urllib2.urlopen(url)
track_list = json.load(response)
for song in track_list:
@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',
@riebschlager
riebschlager / gist:89fa399d034723200321
Last active September 27, 2018 19:12
FFMpeg Snippets
# Image series to video
ffmpeg -y -i %05d.tif -b:v 10M -vcodec mpeg4 video.mov
# Movie to GIF
ffmpeg -i input.mov -r 10 -pix_fmt rgb24 -vf scale=500:500 output.gif
# Webm Encoding
// 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,
#!/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"' {} \;
# 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
#