Skip to content

Instantly share code, notes, and snippets.

View hardillb's full-sized avatar
🚴‍♂️
Suitably Employed

Ben Hardill hardillb

🚴‍♂️
Suitably Employed
View GitHub Profile
@hardillb
hardillb / icsBlink.py
Last active September 8, 2020 17:27
Blink(1)/Digispark+RGB Meeting warning light. A script to find your next appointment in your Google Calendar and change the colour of a your device depending on how much time before it starts. Moving from green at 20min (or more) to red in the last 5 mins before a meeting. The light turns blue for the duration of the meeting.
@hardillb
hardillb / NextCalEntry.java
Last active December 12, 2015 12:09
Set the RGB values for Blink(1)/Digispark+RGB according to the time to the next meeting in your Lotus Notes Calendar. Moving from green at 20min (or more) to red in the last 5 mins before a meeting. The light turns blue for the duration of the meeting.
package uk.me.hardill.notes;
/**
* NextCalEntry
*
* Sets the RGB values for Blink(1)/Digispark+RGB
* according to the time to the next meeting in
* your Lotus Notes Calendar
*
* This should be run with the JRE that ships with
@hardillb
hardillb / httprc
Created March 6, 2013 16:09
Quick script to look up http status codes on their wikipedia page ./httprc 200
#!/bin/sh
links http://en.wikipedia.org/wiki/HTTP_code#$1
@hardillb
hardillb / 78-digiRGB.html
Last active December 23, 2015 03:28
Digispark RGB Node-RED node Use git clone to check this out into the node-red/nodes/hardware directory After you will need to run npm install node-hid in the node-red directory to add the required dependencies
<!--
Copyright 2013 IBM Corp.
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
@hardillb
hardillb / 79-SensorTag.html
Last active December 26, 2015 09:08
Ti SensorTag Node-red node, it depends on the sensortag and noble nodes run "npm install sensortag@https://api.github.com/repos/hardillb/node-sensortag/tarball'' in the node red directory Put these 2 files in nodes/hardware directory. You will need to apt-get libbluetooth-dev to get noble to build during the npm install
<!--
Copyright 2013 IBM Corp.
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
@hardillb
hardillb / test.js
Created October 23, 2013 21:14
Example Sensorttag node app
var SensorTag = require('sensortag');
var node = {};
console.log("starting");
SensorTag.discover(function(sensorTag){
console.log("discovered: " + sensorTag);
console.log(tag);
node.st = tag;

Keybase proof

I hereby claim:

  • I am hardillb on github.
  • I am hardillb (https://keybase.io/hardillb) on keybase.
  • I have a public key whose fingerprint is EDAC A275 E3DC AE15 2432 220F 74DD 0769 79AB B1E7

To claim this, I am signing this object:

@hardillb
hardillb / Sample flow
Created September 10, 2014 09:44
Tata F1 Timing flow
[{"id":"595f8cc.92912f4","type":"file in","name":"","filename":"/data/f1.xml","format":"utf8","x":319.08331298828125,"y":46.083335876464844,"z":"1c9784d4.222773","wires":[["a915baa2.9ecae"]]},{"id":"6a5d6db5.efe6b4","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":96.08332824707031,"y":46.083335876464844,"z":"1c9784d4.222773","wires":[["595f8cc.92912f4"]]},{"id":"8f7943ec.516408","type":"xml","name":"","x":535.0833129882812,"y":142.08334350585938,"z":"1c9784d4.222773","wires":[["d4cb38f5.69dbc"]]},{"id":"730d4af8.19591c","type":"debug","name":"","active":true,"console":"false","complete":"true","x":817.0833129882812,"y":45.083335876464844,"z":"1c9784d4.222773","wires":[]},{"id":"a915baa2.9ecae","type":"function","name":"","func":"var lines = msg.payload.split(\"\\n\");\nvar messages = [];\n\nfor (var i=0; i<lines.length; i++) {\n //deep copy the orginal message to ensure we don't loose any other fields\n var tmp = JSON.parse(JSON.stringify(ms
[{"id":"850a2c6d.e68098","type":"twilio-api","sid":"update-this","from":"+15005550006","name":"SMS out"},{"id":"2672a104.4e7d26","type":"inject","name":"","topic":"","payload":"helloWorld","payloadType":"string","repeat":"","crontab":"","once":false,"x":248.0833282470703,"y":266.9999771118164,"z":"9a815f24.3bf388","wires":[["e758f3a5.ccf1d8"]]},{"id":"e758f3a5.ccf1d8","type":"twilio out","twilio":"850a2c6d.e68098","number":"+4455555555","name":"SMS","x":433.0833282470703,"y":143.00000762939453,"z":"9a815f24.3bf388","wires":[]}]
@hardillb
hardillb / wemo-light.js
Last active November 3, 2016 08:08
Wemo lights example - "npm install wemo-js xml2js" then "node wemo-light.js" for instructions
var wemo = require('wemo-js');
var http = require('http');
var util = require('util');
var xml2js = require('xml2js');
var postbodyheader = [
'<?xml version="1.0" encoding="utf-8"?>',
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">',
'<s:Body>'].join('\n');