Skip to content

Instantly share code, notes, and snippets.

View robstenzinger's full-sized avatar

Rob Stenzinger robstenzinger

View GitHub Profile
@robstenzinger
robstenzinger / list-achievements.sh
Created January 4, 2014 21:08
Shell command, looks for lines of text in .md files in the current directory containing the text "ACHIEVEMENT:", then writes the output/results to a separate file.
# looks for lines of text in .md files in the current directory containing the text "ACHIEVEMENT:"
# > then writes the output/results to a separate file
grep -h -w -i "ACHIEVEMENT:" ./*.md > ./achievements/achievements.md
@robstenzinger
robstenzinger / build-web.sh
Created January 4, 2014 21:19
Build the web preview (useful for testing and debugging) for my ebook. It's essentially a way to use Pandoc to convert Markdown files into a static web site. Kept the file names consistent to the epub book building process to maintain hyperlinks across chapters in both formats.
# build-web.sh
# prep the output directories
mkdir ./_web/illustrations/
mkdir ./_web/audio/
# copy assets to the web structure
rsync --verbose --update --recursive --progress --times ./illustrations/ ./_web/illustrations/
rsync --verbose --update --recursive --progress --times ./audio/ ./_web/audio/
@robstenzinger
robstenzinger / xp-summary.py
Created January 29, 2016 02:45
Based on an Experience Inventory excel file where you've captured data, this script will export reports in excel
from xls2db import xls2db
import xlrd
import sqlite3 as sqlite
import xlsxwriter
import os
#
# SOURCE DATA
#
@robstenzinger
robstenzinger / pi-smartthings-task-runnery.py
Created August 20, 2017 04:11
A Python Flask server to receive API calls from a Smartthings hub. Based on examples at: https://github.com/jrhbcn/smartthings
import RPi.GPIO as GPIO
from flask import Flask, jsonify
import time
# create the flask server app
app = Flask(__name__)
# set the mode on the GPIO pins to be based on counting the pins via
# the the layout:
@robstenzinger
robstenzinger / simulated-garagedoor-controllerV3.groovy
Created August 20, 2017 04:17
A Smartthings Device Handler groovy script. Based on examples at: https://github.com/jrhbcn/smartthings
/**
* Copyright 2015 SmartThings
*
* 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
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@robstenzinger
robstenzinger / makey-game-animal-edition.html
Created September 2, 2017 00:04
Display and feedback for an operation-like game using the Makey-makey, based on: https://makercamp.com/makey-game
<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<title>Makey Makey Animal Hospital</title>
<!--
based on: https://makercamp.com/makey-game
-->
<script>
@robstenzinger
robstenzinger / generating-music-based-on-text-and-seeded-randomality.markdown
Created January 5, 2021 22:25
Generating Music Based on Text and Seeded Randomality

Generating Music Based on Text and Seeded Randomality

Generate music and a visualization based on the text length and sentiment + the given list of rhythms and note patterns + seeded randomness.

This experiment uses:

  • Gibber.js as a synth and sequencer
  • AFINN sentiment analysis to help with generating the music
  • Seeded randomness to be able to generate the same music given the same input
  • P5js to for the UI and visualization of the sound
@robstenzinger
robstenzinger / game-assets.py
Created January 20, 2021 22:16
Takes visual game screen layouts in PSD files, exports the layers in different resolutions, and saves layout data as JSON and Lua. Currently using this for a game built with the Solar2D game platform.
import os
import sys
from psd_tools import PSDImage
import json
import shutil
import math
from PIL import Image
# target resolutions
primary_resolution = (480,320)