Skip to content

Instantly share code, notes, and snippets.

Roberto Calderon calderonroberto

Block or report user

Report or block calderonroberto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stsplatform_fullexample.py
#!/bin/python
import random
import stsplatform.client as sts
# You will need your credentials configured here. Read more here:
# http://wotkit.readthedocs.org/en/latest/api_v1/api_authentication.html#keys-and-basic-authentication
KEY_ID = ''
KEY_PASSWORD = ''
@calderonroberto
calderonroberto / stsplatform-ruby-example.rb
Created Jul 29, 2015
Example using the stsplatform ruby library.
View stsplatform-ruby-example.rb
# Require the stsplatform gem. Make sure to install it
# To install from source run: "bundle exec rake install"
# to install from RubyGems run : "gem install stsplatform"
require 'stsplatform'
# A sensor to use for this example. We will use
SENSOR_NAME = 'calderonroberto.demo'
# First, create a client that will handle all the REST calls
c = STSPlatform::Client.new()
@calderonroberto
calderonroberto / stsplatform-node-example-callbacks.js
Created Aug 1, 2015
Example using the stsplatform module using callbacks.
View stsplatform-node-example-callbacks.js
sts = require('../stsplatform');
// Create a Client.
var client = new sts.Client();
// Create a sensor object, referencing the client/
var sensor = new sts.Sensors(client, 'calderonroberto.demo');
// Get the sensor information (print the response code)
sensor.get(null, function(error,response){
@calderonroberto
calderonroberto / stsplatform-node-example-promises.js
Created Aug 1, 2015
Example using the stsplatform module and promises
View stsplatform-node-example-promises.js
sts = require('../stsplatform');
// Create a Client.
var client = new sts.Client();
// Create a sensor object, referencing the client/
var sensor = new sts.Sensors(client, 'calderonroberto.demo');
// Get the sensor information (print the response code)
sensor.get().then(function(response){
@calderonroberto
calderonroberto / README.md
Last active Sep 14, 2015
The most basic flow.
View README.md

This is the most basic flow. An inject node publishing to a debug node.

@calderonroberto
calderonroberto / main.go
Created Oct 24, 2015
A very simple Golang Microservice
View main.go
package main
import (
"net/http"
"log"
"encoding/json"
)
// The Thing Model, mapping the URL.Query() contents
type Thing struct {
View vowelcount-withif.js
var withIf = function (s) {
var vowels = 0;
for (var i=0; i < s.length-1; i++){
var letter = s[i].toLowerCase();
if (letter === "a" || letter === "e" || letter === "i" || letter === "o" || letter === "u" ){
vowels++;
}
}
return vowels;
};
View vowelcount-withindex.js
var withIndex = function (s) {
var vowels = 0;
var vowelArray = ["a","e","i","o","u"];
for (var i = 0; i < s.length-1; i++){
if (vowelArray.indexOf(s[i].toLowerCase()) !== -1 ) {
vowels++;
}
}
return vowels;
};
@calderonroberto
calderonroberto / vowelcount-withbinary.js
Created Nov 20, 2015
Vowel Count With Binary Search
View vowelcount-withbinary.js
var withBinarySearch = function (s) {
var vowels = 0;
var vowelArray = ["a","e","i","o","u"]; //already sorted
for (var i = 0; i < s.length-1; i++){
var search = binarySearch(vowelArray,s[i].toLowerCase(),0,4);
if ( search !== -1 ){
vowels++;
}
}
return vowels;
View node-red-sox-examples.json
[{"id":"d641037b.29bf","type":"websocket-listener","path":"/public/gassentiment","wholemsg":"false"},{"id":"b2e20edd.4d1df","type":"pushbullet-config","name":"PushBullet"},{"id":"496da66e.b69258","type":"wotkit-credentials","nickname":"DataHub","url":"http://hub.urbanopus.net/wotkit/"},{"id":"dd0cde9b.22f32","type":"sox-credentials","nickname":"Sensorizer","bosh":"http://sox.ht.sfc.keio.ac.jp:5280/http-bind/","xmpp":"sox.ht.sfc.keio.ac.jp"},{"id":"57c3f620.a83c08","type":"sox in","name":"","device":"神奈川ガソリン安価ランキング1位","transducer":"price","login":"dd0cde9b.22f32","x":158.0994110107422,"y":84,"z":"e9240feb.16dbf","wires":[["1b9117d3.e46ee8"]]},{"id":"bf10dd9c.40ef2","type":"comment","name":"Sensor Details","info":"http://sensorizer.ht.sfc.keio.ac.jp:8888/status?n=c838934feb10e75a06424c0c963a45ae\n\nCredentials:\n\nsensorizer@sox.ht.sfc.keio.ac.jp\nmiromiro\n","x":80.5,"y":149,"z":"e9240feb.16dbf","wires":[]},{"id":"1b9117d3.e46ee8","type":"function","name":"Extract Price Value","func":"if (msg.payload.name == \
You can’t perform that action at this time.