I hereby claim:
- I am thatguydan on github.
- I am danfriedman (https://keybase.io/danfriedman) on keybase.
- I have a public key ASBQMd7gbEFnWrORRuf3P1vXwz-RkCdvKg9Q_9vMU9MDtAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var ip = 'api.ninja.is'; // Can also be the IP address of the machine running the client code | |
var ACCESS_TOKEN='API_ACCESS_TOKEN'; // Obtained from https://a.ninja.is/hacking | |
var port = 443; // Should be 8000 if talking locally | |
var NODE = "F9C342600F237BBE"; // In your client code terminal | |
var G = '01'; | |
var V = 0; | |
var D = 1007; | |
//Register for NFC event to handle discovered tag. | |
device.nfc.on("found", handleNfcTag); |
var util = require('util') | |
, stream = require('stream') | |
, os = require('os') | |
, helpers = require('./lib/helpers') | |
, Hue = require('hue.js') | |
, Light = require('./lib/Light'); | |
util.inherits(hue,stream); | |
module.exports = hue; |
var util = require('util') | |
, stream = require('stream') | |
, os = require('os') | |
, helpers = require('./lib/helpers') | |
, Hue = require('hue.js'); | |
util.inherits(hue,stream); | |
module.exports = hue; | |
function hue(opts,app) { |
// Copyright Joyent, Inc. and other Node contributors. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, subject to the | |
// following conditions: | |
// |
ninja.devices('humidity',function(err,devices) { | |
// Returns all your humidity devices as guid => metadata | |
// So we iterate over each humidity device | |
for (var guid in devices) { | |
ninja.device(guid).data(function(err,data) { | |
// …data for that humidity sensor | |
}); | |
} | |
}); |
/* | |
1) Model everything | |
- User | |
- Block | |
- Device | |
- Credential | |
- Rule | |
- Token |
var EventEmitter = require('events').EventEmitter; | |
function User() { | |
var self = this; | |
this.create = function(email,password) { | |
self.once('_insertIntoDbEvent',function(err) { | |
/* |
{ | |
"rule": { | |
"shortName": "Nerf Gun Shooter", | |
"preconditions": [ | |
{ | |
"handler": "ninjaChange", // When we receive the trip-wire string from the RF module | |
"params": { | |
"guid": "RFID_DEVICE_GUID", | |
"to": "10101000101000001010101" | |
} |