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 express = require('express'); | |
var session = require('cookie-session'); | |
var ApiClient = require('api-poc-client'); | |
var request = require('superagent'); | |
// SETUP | |
var app = module.exports = express(); | |
var client = new ApiClient({ | |
authServer: "https://id.sandbox.sparebank1.no", | |
clientId: "client-id-from-the-ID-portal", |
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
package main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
"golang.org/x/oauth2" | |
"fmt" | |
"io/ioutil" | |
"github.com/bmizerany/pat" |
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
exports.createPlot = function(container, data, name) { | |
return chart1 = new Highcharts.Chart({ | |
chart: { | |
renderTo: container, | |
zoomType: 'x' | |
}, | |
title: { | |
text: name.charAt(0).toUpperCase() + name.substring(1)+'´s Moisture levels' | |
}, | |
subtitle: { |
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 valueUpdated = function(snapshot) { | |
var name = this.props.name; | |
if(chart) { | |
var series = chart.series[0]; | |
var x = Date.now(); | |
series.addPoint([x, snapshot.val().watervalue], true, true) | |
} | |
} |
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
componentDidMount: function() { | |
console.log(this.getDOMNode()); | |
Highcharts.setOptions({ | |
global: { | |
timezoneOffset: -1*60 | |
} | |
}) | |
var that = this; | |
var name = this.props.name; |
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
initTokens: function() { | |
var _this = this; | |
_(this.splitAndTrim(this.$originalInput.val())).each(function(token) { | |
_this.tokens.add(token); | |
}); | |
}, |
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 System.Web.Mvc; | |
namespace BEKK_Radar.Web.Helpers.CustomFilters | |
{ | |
public class CorsActionFilter : ActionFilterAttribute, IActionFilter | |
{ | |
void IActionFilter.OnActionExecuting(ActionExecutingContext context) | |
{ | |
if (context.HttpContext.Request.RequestType.Equals("POST")) return; | |
context.HttpContext.Response.AddHeader("Access-Control-Allow-Origin","*"); |
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
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="ModelFartSensorDriver"> | |
<implementation class="model.fartsensor.ModelFartSensor"/> | |
<reference bind="setServerApi" cardinality="1..1" interface="ntnu.opcua.server.api.ServerApi" name="ServerApi" policy="static" unbind="unsetServerApi"/> | |
<reference bind="setFartSensor" cardinality="1..1" interface="hardware.driver.api.HardwareAPI" name="HardwareAPI" policy="static" target="(hardware=fartsensor)" unbind="unsetFartSensor"/> | |
<service> | |
<provide interface="org.osgi.service.event.EventHandler"/> | |
</service> | |
<property name="event.topics" value="ntnu/opcua/server/STARTED"/> | |
<reference bind="setNameSpaceController" cardinality="1..1" interface="ntnu.opcua.namespace.controller.api.NameSpaceControllerAPI" name="NameSpaceControllerAPI" policy="static" unbind="unsetNameSpaceController"/> | |
</scr:component> |
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
fartSensorObjectFolder = new FolderType(fartSensorNodeManager, fartSensorObjectId, "FartSensorObject", Locale.ENGLISH); | |
//FOLDER FOR MY FARTSENSOR | |
fartSensorNodeManager.addNodeAndReference(objectsFolder, fartSensorObjectFolder, Identifiers.Organizes); | |
//FART SENSOR DEVEICE TYPE | |
final NodeId fartSensorTypeId = new NodeId(ns, "FartSensorType"); | |
UaObjectType fartSensorType = new UaObjectTypeNode(fartSensorNodeManager, fartSensorTypeId, "FartSensorType", Locale.ENGLISH); | |
fartSensorNodeManager.addNodeAndReference(baseObjectsType, fartSensorType, Identifiers.HasSubtype); | |
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
service.pid=ntnu.opcua.hardware.viperwim | |
hardware=viperWIM |