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
| const { gql } = require('apollo-server-express'); | |
| const typeDefs = gql` | |
| type SensorData { | |
| temp: Float! | |
| humid: Float! | |
| time: String! | |
| } |
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
| const { MQTTPubSub } = require('graphql-mqtt-subscriptions'); | |
| const { connect } = require('mqtt'); | |
| const client = connect('mqtt://mqtt.eclipse.org', { | |
| reconnectPeriod: 1000 | |
| }); | |
| const pubsub = new MQTTPubSub({ | |
| client | |
| }); |
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
| const http = require('http'); | |
| const express = require('express'); | |
| const { ApolloServer } = require('apollo-server-express'); | |
| // GraphQL Schema and Resolvers | |
| const { typeDefs } = require('./graphql/schema'); | |
| const { resolvers } = require('./graphql/resolvers'); | |
| const server = new ApolloServer({ typeDefs, resolvers }); | |
| const app = express(); |
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
| { | |
| "test": "This JSON will keep changing", | |
| "version" : 0.3, | |
| "url": "https://stackoverflow.com/questions/12522539/github-gist-editing-without-changing-url", | |
| "features": [ | |
| "Feature1", | |
| "Feature2", | |
| "Feature3" | |
| ] | |
| } |
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
| # Change Stream Example | |
| # using PYMONGO v3.9.0 | |
| import sys | |
| import pprint | |
| from pymongo import MongoClient | |
| # Create a Client to our Replica Set | |
| cl = MongoClient(host='localhost', port=37017, replicaSet='rs0') | |
| # Database: `team` # Collection: `players` |
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
| /* Arduino Sketch to Program an ESP32 to read LSM9DS0 Sensor from | |
| * its I2C Bus, convert the data into InfluxDB's Line Protocol Strings | |
| * and Publish it to an MQTT broker running on an IoT Edge Device (Pi4) | |
| * Author: Shan Desai <https://github.com/shantanoo-desai> | |
| */ | |
| #include <Wire.h> | |
| #include <SPI.h> | |
| #include <Adafruit_LSM9DS0.h> | |
| #include <Adafruit_Sensor.h> |
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
| language: node_js | |
| services: | |
| - 'docker' | |
| node_js: | |
| - "10" | |
| - "12" | |
| cache: |
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
| #include <Wire.h> | |
| #include <SPI.h> | |
| #include <Adafruit_LSM9DS0.h> | |
| #include <Adafruit_Sensor.h> | |
| #include <WiFi.h> | |
| #include <WiFiClientSecure.h> | |
| #include <PubSubClient.h> | |
| // CERTIFICATE Header File |
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
| # IOT/sensor2/temp | |
| env,type=A temp=23.39 | |
| env,type=B temp=40.00 | |
| # IOT/sensor1/acc | |
| env,type=A x=0.2 | |
| env,type=B x=1.3 |
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
| [agent] | |
| interval = "2s" | |
| round_interval = true | |
| metric_batch_size = 1000 | |
| metric_buffer_limit = 12000000 |