Skip to content

Instantly share code, notes, and snippets.

@matbee-eth
matbee-eth / server.js
Created May 18, 2011 20:08
Nodester, Express, SMSified
var http = require('http');
var express = require('express');
var app = express.createServer();
app.get('/', function(req, res){
res.render('./index.html');
});
app.listen(10083);
@matbee-eth
matbee-eth / server.js
Created May 20, 2011 18:46
SMSified nodejs script
/*
*
* SMS Number Classes
*
*/
function NumberClass (Address) {
var self = this;
//console.log(Address);
this._messages = [];
@matbee-eth
matbee-eth / server.js
Created September 29, 2011 16:15
NodeJS tropo-webapi
app.post('/inboundTropo', function (req, res) {
res.contentType('application/json');
console.log('INBOUND TROPO MESSAGE: ');
console.log(req.body);
var tropo = new TropoWebAPI();
tropo.message(req.body.session.parameters.msg, { to:req.body.session.parameters.to, network:"SMS" });
res.send(TropoJSON(tropo));
// Using nodeJS & express.
var Tropo = require('tropo-webapi');
app.post('/inbound', function(req, res) {
var webapi = new Tropo.TropoWebAPI();
var say = {value: "This is my message."}
webapi.message(say, "18882220101", false, "TEXT");
res.send(TropoJSON(webapi));
});
@matbee-eth
matbee-eth / desc.js
Created January 12, 2012 18:34
desc
test: {
one: 'one',
two: ['three','four', {five: 'six'}]
}
@matbee-eth
matbee-eth / API.js
Created May 15, 2012 20:57
Javascript method delayed chaining
// var test = new API("Router.svc");
// test.get().top(5).view("map");
// It should execute() only when the last function has been called.
var API = function (webservice) {
this.webservice(webservice);
return this;
};
API.prototype = {
var observable = function (data) {
var _data = data;
var _callbacks = [];
var self = this;
this.subscribe = function (callback) {
_callbacks.push(callback);
};
this.get = function () {
root@MathieuGosbeeHPPre:~/nvm/src/node-v0.6.18# make
Waf: Entering directory `/var/home/root/nvm/src/node-v0.6.18/out'
DEST_OS: linux
DEST_CPU: arm
Parallel Jobs: 1
Product type: program
[ 5/35] libv8.a: deps/v8/SConstruct -> out/Release/libv8.a
/opt/bin/python "/var/home/root/nvm/src/node-v0.6.18/tools/scons/scons.py" -j 1
-C "/var/home/root/nvm/src/node-v0.6.18/out/Release/" -Y "/var/home/root/nvm/src
/node-v0.6.18/deps/v8" visibility=default mode=release arch=arm toolchain=gcc li
root@MathieuGosbeeHPPre:~/nvm/src/node-v0.6.18# make
Waf: Entering directory `/var/home/root/nvm/src/node-v0.6.18/out'
DEST_OS: linux
DEST_CPU: arm
Parallel Jobs: 1
Product type: program
[ 5/35] libv8.a: deps/v8/SConstruct -> out/Release/libv8.a
/opt/bin/python "/var/home/root/nvm/src/node-v0.6.18/tools/scons/scons.py" -j 1
-C "/var/home/root/nvm/src/node-v0.6.18/out/Release/" -Y "/var/home/root/nvm/src
/node-v0.6.18/deps/v8" visibility=default mode=release arch=arm toolchain=gcc li
C:\Program Files (x86)\HP webOS\SDK\bin>palm-log org.webosinternals.tailor
retrieving logs for application org.webosinternals.tailor on device "roadrunner-
linux" {2503fd80ef7051c38ce8fe2539ea159a0e99399d} usb 55322
[20120606-22:52:16.057006] error: Uncaught SyntaxError: Unexpected token ;, app/
assistants/startup-assistant.js:27
[20120606-22:52:16.111541] error: The scene 'startup' could not be pushed becaus
e an exception occurred.
[20120606-22:52:16.113464] error: Error: require Failed: The scene assistant 'St
artupAssistant' is not defined. Did you remember to include it in sources.json?,
line undefined, file undefined