This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
argo() | |
.post('/loc', function(handle){ | |
handle('request', function(env, next){ | |
env.request.getBody(function(err, body) { | |
if(err) { | |
//blah | |
} else { | |
//Get usergrid object | |
//This would be something from the SDK. | |
var usergridObject = getUgObj(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Using an MQTT client with the arduino yun. | |
*/ | |
#include <SPI.h> | |
#include <Bridge.h> | |
#include <YunClient.h> | |
#include <PubSubClient.h> | |
byte mac[] = {0x90, 0xA2, 0xDA, 0xF0, 0x0E, 0x0A}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var WebSocketServer = require('ws').Server; | |
var webSocket = null; | |
var server = http.createServer(function(req, res) { | |
var requestLine = [req.method.toUpperCase(), req.url, 'HTTP/' + req.httpVersion + '\r\n'].join(' '); | |
Object.keys(req.headers).forEach(function(header) { | |
requestLine += header + ': ' + req.headers[header] + '\r\n'; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Readable = require('stream').Readable; | |
var util = require('util'); | |
var Incoming = module.exports = function (opt) { | |
this.stream = opt.stream; | |
Readable.call(this, opt); | |
}; | |
util.inherits(Incoming, Readable); | |
Incoming.prototype._read = function(n) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HelloApp = module.exports = function() { | |
this.name = 'hello'; | |
}; | |
HelloApp.prototype.init = function(fog) { | |
fog.provision('photosensor', function(photosensor){ | |
photosensor.on('change', function(value) { | |
if (value < 100) { | |
led.call('turn-on'); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************* | |
Elroy Service. Basic. | |
We'll be discovering where this is on the network with bonjour/mdns. | |
Then we'll interact with it. | |
Posting to the /on endpoint will turn pin 13 on. | |
Posting to the /off endpoint or any other endpoint will turn pin 13 off. | |
*********************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HueDriver = module.exports = function() { | |
this.states [ | |
{ | |
state: 'on', | |
transitions: [ | |
{ 'turn-off': this.turnOff }, | |
{ | |
'set-color': this.setColor, | |
'inputs': [ | |
{ 'name':'RGB', 'type':'text'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Xcode | |
.DS_Store | |
build/ | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 | |
!default.mode2v3 | |
*.perspectivev3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* WiiChuckDemo -- | |
* | |
* 2008 Tod E. Kurt, http://thingm.com/ | |
* | |
*/ | |
#include <Wire.h> | |
#include "nunchuck_funcs.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************** | |
****************************************************/ | |
#include <Adafruit_CC3000_UDP_Server.h> | |
#include <Adafruit_CC3000_ClientRef.h> | |
#include <SPI.h> | |
#include "utility/debug.h" | |
#include "utility/socket.h" | |
#include "protocol.h" |