Skip to content

Instantly share code, notes, and snippets.

View jnpoyser's full-sized avatar

James Poyser jnpoyser

View GitHub Profile
@jnpoyser
jnpoyser / hs-ping.rb
Last active February 17, 2018 15:09
Toggles a Homeseer device on and off every 10s, and checks status - for debugging zwave issues
require 'net/http'
require 'json'
# Remember to enable control using JSON in HS
HS_IP_ADDRESS = '192.168.1.201'
HS_PORT = 80
HS_DEVICE_REF = 146
HS_DEVICE_STATUS_ON = 255 # Will toggle between these
HS_DEVICE_STATUS_OFF = 0 # Will toggle between these
LOG_FILE = 'zw-ping.log'
@jnpoyser
jnpoyser / gist:c1b58bd7b14bb0bd967f
Created January 12, 2015 18:33
Very trivial example of using voice commands on OS X
class ViewController: NSViewController, NSSpeechRecognizerDelegate {
var speech = NSSpeechRecognizer.init()
override func viewDidLoad() {
super.viewDidLoad()
speech.commands = ["Fill form", "Follow link","NHS","A&E"]
speech.listensInForegroundOnly = false