Skip to content

Instantly share code, notes, and snippets.

Chris Riebschlager riebschlager

Block or report user

Report or block riebschlager

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hyvee.ino
// 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);
View util.js
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;
View Find and convert
#!/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"' {} \;
View dot-shrink.js
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
@riebschlager
riebschlager / bridgeify.py
Created Sep 13, 2016
Create Spotify playlists based on the last 24 hours of music played by The Bridge - https://bridge909.org/
View bridgeify.py
import spotipy
import spotipy.util as util
import time
import urllib
import urllib2
import json
from datetime import datetime
from datetime import timedelta
View ktbg_playlist_to_csv.py
import urllib2
import json
import csv
import time
import math
from datetime import datetime
from datetime import timedelta
epoch = datetime.utcfromtimestamp(0)
View kcrw_playlist_to_csv.py
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:
View NWHoF Client API
Base URL: http://nwhof.org/champions/public/hofRPC.php
Required Post Params
id: Doesn't seem to matter what it is. Just leave it at 1.
method: A method defined in hallOfFameFrontEnd.php
params: An array of params used by the method
Example call:
@riebschlager
riebschlager / site-kiosk.html
Created May 19, 2016
Launching an application via Site Kiosk
View site-kiosk.html
<!--
http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/add_programs.htm
-->
<html>
<head>
<script type="text/javascript">
function Init_ScriptInterface() {
window.external.InitScriptInterface();
}
function ExecuteProg() {
View using-q.js
app.controller('AppCtrl', function($scope, $q, $http) {
var reqs = [
$http.get('http://10.40.110.202/api/videos/'),
$http.get('http://10.40.110.202/api/videos/'),
$http.get('http://10.40.110.202/api/videos/')
];
$q.all(reqs).then(function(data){
console.log(data[0]); // Response from the 1st request
You can’t perform that action at this time.