This file contains 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
void temperatureHumidity_MeasurementComplete(TemperatureHumidity sender, double temperature, double relativeHumidity) | |
{ | |
//may as well take a light reading as well | |
double lightPercentage = lightSensor.ReadLightSensorPercentage(); | |
//create a new sensor reading and set the values | |
var reading = new SensorReading() | |
{ | |
SensorID = "nicks-office", //can you believe i have to share my office with http://ntotten.com ? | |
Temp = temperature, |
This file contains 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 Pusher = require('pusher'); | |
function insert(item, user, request) { | |
request.execute({ | |
success: function() { | |
// After the record has been inserted, trigger immediately to the client | |
request.respond(); | |
// Publish event for all other active clients | |
publishItemCreatedEvent(item); | |
} |
This file contains 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
@{ | |
ViewBag.Title = ".NET MicroFramework, Mobile Services + Pusher demo"; | |
} | |
<h2>Mobile Services - Sensor Demo</h2> | |
<div id="chartdiv" style="height:600px;width:800px;display:none"></div> | |
<br /> | |
<div id="lightdiv" style="height:600px;width:800px;display:none"></div> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>@ViewBag.Title</title> | |
@*Add Pusher script reference*@ | |
<script type="text/javascript" src="http://js.pusher.com/1.12/pusher.min.js" /> | |
@Styles.Render("~/Content/css") | |
@Scripts.Render("~/bundles/modernizr") |
This file contains 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
public partial class Program | |
{ | |
private GT.Timer timer = new GT.Timer(5000); | |
void ProgramStarted() | |
{ | |
// Event that fires when a measurement is ready | |
temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete); | |
ethernet_J11D.Interface.NetworkAddressChanged += new NetworkInterfaceExtension.NetworkAddressChangedEventHandler(Interface_NetworkAddressChanged); | |
ethernet_J11D.DebugPrintEnabled = true; |
This file contains 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 Microsoft.WindowsAzure.MobileServices; | |
namespace SensorDemoMobileServices | |
{ | |
public partial class Program | |
{ | |
//TODO: add your mobile service URI and app key below from the Windows Azure Portal https://manage.windowsazure.com | |
public static MobileServiceClient MobileService = new MobileServiceClient( | |
new Uri("http://<your Windows Azure Mobile Service subdomain >.azure-mobile.net/"), | |
"<your Windows Azure Mobile Service App Key> " |
This file contains 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 System; | |
using System.Collections; | |
using System.Threading; | |
using Microsoft.SPOT; | |
using Microsoft.SPOT.Presentation; | |
using Microsoft.SPOT.Presentation.Controls; | |
using Microsoft.SPOT.Presentation.Media; | |
using Microsoft.SPOT.Touch; | |
using Gadgeteer.Networking; |
This file contains 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 System; | |
using Microsoft.SPOT; | |
using Microsoft.Azure.Zumo.MicroFramework.Core; | |
namespace SensorDemoMobileServices | |
{ | |
public class SensorReading : IMobileServiceEntity | |
{ | |
public int Id { get; set; } | |
public string SensorID { get; set; } |
This file contains 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
function CheckFeed() { | |
getUpdatesAndNotify(); | |
} | |
var request = require('request'); | |
function getUpdatesAndNotify() { | |
request('http://search.twitter.com/search.json?q=@cloudnick&rpp=2', | |
function tweetsLoaded (error, response, body) { | |
var results = JSON.parse(body).results; | |
if(results){ |
This file contains 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 azure = require('azure'); | |
var qs = require('querystring'); | |
function insert(item, user, request) { | |
var accountName = '<replace with your storage account name>'; | |
var accountKey = '<replace with your storage account key>'; | |
var host = accountName + '.blob.core.windows.net'; | |
var canonicalizedResource = '/' + item.containerName + '/' + item.resourceName; | |
//Must be lowercase | |
item.containerName = item.containerName.toLowerCase(); |
NewerOlder