Skip to content

Instantly share code, notes, and snippets.

View JasonMillward's full-sized avatar
🐝
I may be slow to respond.

Jason JasonMillward

🐝
I may be slow to respond.
View GitHub Profile
var debug = true;
function log(str) {
if (debug) {
var currentTime, h, m, s;
currentTime = new Date;
h = currentTime.getHours();
m = currentTime.getMinutes();
s = currentTime.getSeconds();
try {
#!/bin/bash
ghost_path=$1
if [ -z $ghost_path ]; then
echo "Usage: $0 <ghost path>";
exit 1;
fi
forever stopall
@JasonMillward
JasonMillward / spritesheetExtractor.py
Created May 12, 2017 03:22
Extract .png files from a compiled sprite sheet Raw
import binascii
import re
import os
for directory, subdirectories, files in os.walk('.'):
for file in files:
if not file.endswith('.bin'):
continue
#include <Adafruit_NeoPixel.h>
#include "ESP8266WiFi.h"
#define PIN D4
Adafruit_NeoPixel strip = Adafruit_NeoPixel(10, PIN, NEO_GRB + NEO_KHZ800);
bool discomode = true;
void setup() {
import json
from urllib2 import Request, urlopen
import psutil
import os
def octoprint(path):
q = Request("http://10.0.0.60/api/{}".format(path))
q.add_header("X-Api-Key", "[YOUR API KEY GOES HERE]")
a = urlopen(q).read()