Skip to content

Instantly share code, notes, and snippets.

Ben Hardill hardillb

Block or report user

Report or block hardillb

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
@hardillb
hardillb / icsBlink.py
Last active Dec 12, 2015
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.
View icsBlink.py
@hardillb
hardillb / NextCalEntry.java
Last active Dec 12, 2015
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.
View NextCalEntry.java
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 Mar 6, 2013
Quick script to look up http status codes on their wikipedia page ./httprc 200
View httprc
#!/bin/sh
links http://en.wikipedia.org/wiki/HTTP_code#$1
@hardillb
hardillb / 78-digiRGB.html
Last active Dec 23, 2015
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
View 78-digiRGB.html
<!--
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 Dec 26, 2015
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
View 79-SensorTag.html
<!--
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 Oct 23, 2013
Example Sensorttag node app
View test.js
var SensorTag = require('sensortag');
var node = {};
console.log("starting");
SensorTag.discover(function(sensorTag){
console.log("discovered: " + sensorTag);
console.log(tag);
node.st = tag;
View keybase.md

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 Sep 10, 2014
Tata F1 Timing flow
View Sample 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
View instructions
[{"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 Nov 3, 2016
Wemo lights example - "npm install wemo-js xml2js" then "node wemo-light.js" for instructions
View wemo-light.js
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');
You can’t perform that action at this time.