Skip to content

Instantly share code, notes, and snippets.

View danielpeintner's full-sized avatar

danielpeintner

View GitHub Profile
@danielpeintner
danielpeintner / example-client.js
Last active November 2, 2022 07:46
node-wot (basic authentication)
// example-client.js
Servient = require("@node-wot/core").Servient
HttpClientFactory = require("@node-wot/binding-http").HttpClientFactory
Helpers = require("@node-wot/core").Helpers
// create Servient and add HTTP binding
let servient = new Servient();
servient.addCredentials({
"urn:dev:wot:org:eclipse:thingweb:my-example-secure": {
@danielpeintner
danielpeintner / index.d.ts
Last active June 4, 2021 14:20
WoT TypeScript definititions
import WoTImpl from '../../src/wot-impl';
import { ThingDescription as ThingDescriptionSchema } from './thing-description';
declare module "wot-typescript-definitions" {
/**
* Dictionary that represents the constraints for discovering Things as key-value pairs.
*/
export interface ThingFilter {
/********************************************************************************
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and
* Document License (2015-05-13) which is available at
@danielpeintner
danielpeintner / xml-rules.md
Last active December 2, 2022 09:48
XML <--> JSON
@danielpeintner
danielpeintner / index.html
Created June 6, 2023 09:28
fullcalendar-ics-issue
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>
Dynamically switch between timezones - Demos | FullCalendar
</title>
// demo-opcua1.ts
import { Servient } from "@node-wot/core";
import { OPCUAClientFactory } from "@node-wot/binding-opcua";
const thingDescription : WoT.ThingDescription = {
"@context": "https://www.w3.org/2019/wot/td/v1",
"@type": ["Thing"],
securityDefinitions: { nosec_sc: { scheme: "nosec" } },
security: "nosec_sc",
title: "servient",
// demo-opcua1.js
Servient = require("@node-wot/core").Servient;
OPCUAClientFactory = require("@node-wot/binding-opcua").OPCUAClientFactory;
const thingDescription = {
"@context": "https://www.w3.org/2019/wot/td/v1",
"@type": ["Thing"],
securityDefinitions: { nosec_sc: { scheme: "nosec" } },
security: "nosec_sc",
title: "servient",
@danielpeintner
danielpeintner / README.txt
Created June 15, 2023 11:35
mashup-opcua-counter-v1
npm install @node-wot/core
npm install @node-wot/binding-opcua
npm install @node-wot/binding-http
# Demo
## 1. Open counter website
Open http://plugfest.thingweb.io/examples/counter.html and listen on change events.
Note: Doing so the counter value will be updated in the UI once "someone" changes the value
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.ReadOnlyBooleanWrapper;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.*;