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 https = require('https'); | |
exports.handler = function(event, context) { | |
var appkey = 'YOUR_REALTIME_APPKEY'; | |
var privatekey = 'YOUR_REALTIME_PRIVATEKEY'; | |
var channel = 'aws-iot'; | |
var message = JSON.stringify(event); | |
var postBody = "AK=" + appkey + "&PK=" + privatekey + "&C=" + channel + "&M=" + message; | |
var headers = { |
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 Realtime = require("realtime-storage"); | |
var fromSR; | |
var toSRCreate; | |
var toSRCopy; | |
// Creates destination table and copies items from origin table | |
function migrate(fromAppKey, fromPrivateKey, toAppKey, toPrivateKey, table) | |
{ |
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> | |
<script src="http://storage-cdn.realtime.co/storage/1.0.0/realtime-storage-min.js"></script> | |
<script src="migration.js"></script> | |
</head> | |
<body> | |
<h1>Realtime Cloud Storage: Copy items |
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
//UI | |
Titanium.UI.setBackgroundColor('#000'); | |
var win1 = Titanium.UI.createWindow({ | |
backgroundColor:'#fff' | |
}); | |
var label1 = Titanium.UI.createLabel({ | |
color:'#777', | |
text:'Connecting to Realtime Storage...', |
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 trelloComment(res){ | |
res.send(200); | |
} |
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 trelloComment(res,req,modules){ | |
// send a log to the remote console | |
modules.storageMule.log("trelloComment: ", JSON.stringify(req)); | |
// find out the trello action triggered | |
var trelloAction = req.body.action.type; | |
// it's a comment | |
if(trelloAction == "commentCard") { |
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) incrementPlayerScore:(NSDictionary *) playerScore WhitScore:(NSNumber *) score OnCompletion:(void (^)(BOOL finished)) completion { | |
NSNumber *totalScore = [NSNumber numberWithInt:([[playerScore objectForKey:SK_SCORES] intValue] + [score intValue])]; | |
ItemRef *itemRef = [[_storageRef table:TAB_SCORES] item:[playerScore objectForKey:PK_SCORES] secondaryKey:[playerScore objectForKey:SK_SCORES]]; | |
[itemRef del:^(ItemSnapshot *success) { | |
NSDictionary *newScore = [NSDictionary dictionaryWithObjectsAndKeys: | |
[playerScore objectForKey:PK_SCORES], PK_SCORES, | |
totalScore, SK_SCORES, |
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
<html ng-app> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script> | |
<script type="text/javascript" src="https://storage-cdn.realtime.co/storage/1.0.0/realtime-storage-min.js"></script> | |
<link rel="stylesheet" type="text/css" href="pure-speech.css"> | |
<script type="text/javascript"> | |
function ChatCtrl($scope) { |
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
<html> | |
<head> | |
<title>Announcement channels test</title> | |
<script type="text/javascript" src="http://dfdbz2tdq3k01.cloudfront.net/js/2.1.0/ortc.js"></script> | |
</head> | |
<body> | |
<script> | |
loadOrtcFactory(IbtRealTimeSJType, function (factory, error) { | |
if (error != null) { |
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="ISO-8859-1"> | |
<title>Insert title here</title> | |
<script type="text/javascript" src="http://storage-cdn.realtime.co/storage/1.0.0/realtime-storage-min.js"></script> | |
</head> | |
<body> | |
<a href="javascript:void;" title="previous messages" id="aPreviousMessages">previous messages</a> | |
<script type="text/javascript" src="list.js"></script> |
NewerOlder