Skip to content

Instantly share code, notes, and snippets.

View jpwsutton's full-sized avatar

James Sutton jpwsutton

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDPfcQzU14UpKDJGEvr9cK3+DB/I48plbMCoI3FIX9UxW028Po9bQE7OcYNXp76px0m7NYvqHOnj8xKS4oJes+Q/8cQvbnbge46NwCj8wSCQZmysGLZk9g6AtCkCWXII+WW24oZspxXaNc0qMogtAx8izycMnYjZwQlkS9MzPMgLGT0giyqem9MRiu8XoqVc0/EteonzDCKw2CV1mNWKkjzw1AgTaIrM8zR1kdqMQkQO+8BL298zBcoUvPpyiHSBQrWPbq6nhqVedbFS3JNBsx+CiBjWttP2Px4ATyut1j7iQ//dBPZkt0TYmxMlGm6IZL18qxNh71gyZnyZGgwtO8K7TWbksDZL+WHI5vX69BUNvFsqwjwDEOJJJ0b6zIMgp4uzT0MdJoXcRHtzuq6VlrE36yjZpnx+dCzhtxZHFT8fFGr9O2QhxAVeTVOESVqc6LEIyP4qE+JdCXsY3I2YfUJPdgEV0LejeZPKmFsXDVQvuYRP/0Uej9MQDT+9j8sMxM= jamessutton@Jamess-MacBook-Pro.local
jpwsutton /
Created December 31, 2021 16:07
Headless d3-celstial

Headless d3-celestial setup

This gist is a bit of a hack that lets you generate a d3-celestial svg without a web browser.


git clone npm install jsdom

Finally, add a lib directory and download require.js into it from here:

jpwsutton /
Created February 6, 2021 22:41
A very rough python script to synchronise dubbed audio from different videos.
This script will take a Pair of VCD video files as well as a High Quality Blu Ray Rip
and will syncronise the audio and add it as a new track.
# Import Libraries
from pathlib import Path
jpwsutton /
Created January 1, 2019 17:57
Microbit Python Script to control a light up dragon egg
from microbit import *
from neopixel import NeoPixel
num_pixels = 47
purple = (64,0,64)
red = (255,0,0)
off = (0,0,0)
speed = 50 # in ms
steps = 20
currentColour = off
jpwsutton / wireClip.scad
Last active November 28, 2018 21:14
$fn = 60;
//LED Dimensions
led_d=8; //LED Diameter
led_h=11; //LED Height
led_fh=2; //LED FLange Thickness
led_fd=9; //LED Flange Diameter
led_flt=4; // The length of the flat bit
// Wireclip module
jpwsutton / instax-flow.js
Last active May 30, 2018 07:53
Node-Red flow for controlling and connecting to a Fujifilm INSTAX Printer
"id": "5e4a70ef.bac7a",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
"id": "17f15d16.6e3143",
jpwsutton / nr-mqttsn-bridge.json
Created March 25, 2018 19:35
[{"id":"305d953b.4abf6a","type":"tab","label":"Robot","disabled":true,"info":""},{"id":"910d848f.a215b8","type":"tab","label":"AT Commands","disabled":false,"info":""},{"id":"8a4dab5a.1db6c8","type":"tab","label":"Network","disabled":false,"info":""},{"id":"2cd98bfb.5a9a54","type":"mqtt-broker","z":"","broker":"","port":"1883","clientid":"d:jit4q3:GlowOrbControl:bce8-ff91","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":""},{"id":"d4571afa.2a9fa8","type":"mqtt-broker","z":"","name":"Personal IoT","broker":"","port":"1883","clientid":"a:wdwf42:red","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"2f2480a5.7e57b","type":"ui_tab","z":"","name":
Muji Cuckoo Clock MQTT Controller V1.0
James Sutton - 2017
To trigger the cuckoo animation, publish an mqtt message with the payload of '1' to the topic
described in the settings below.
Use board "WeMos D1 R2 & mini"
CPU 160MHz
jpwsutton / eventbutton.ino
Created October 3, 2017 16:34
Event button alternate using HTTP
Each time the input pin goes from LOW to HIGH (e.g. because of a push-button
press), the output pin is toggled from LOW to HIGH or HIGH to LOW. There's
a minimum delay between toggles to debounce the circuit (i.e. to ignore
The circuit:
* LED attached from pin 13 to ground
jpwsutton / glowOrb.ino
Created October 3, 2017 16:32
Glow Orb
Rehau VOC Glow Orb
Gas visual alert using a Rehau VOC, WeMoS D1 ESP-8266 board and IBM Bluemix Quickstart.
Expects to receive a number, in ASCII, over MQTT, which it compares to a threshold to decide whether
to display red or green. e.g. "400"
by Andy Stanford-Clark - with embellishments by Lucy Rogers