This demo shows you how to build an infrastructure monitoring tool, similar to a mini-datadog, that keeps track of some stats from all of the computers running this included script. Using this data, we can plot time series and build something based on "real" data being captured in the moment.
This file contains 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
function sendDataToTinybird() { | |
// 1. Get Data from the Sheet | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var rows = sheet.getRange('A1:C2').getValues(); // Modify this range as needed | |
// 2. Define the options common to all requests | |
var headers = { | |
Authorization: 'Bearer YOUR_AUTH_TOKEN' // Replace with your token | |
}; |
This file contains 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
import asyncio | |
from viam.robot.client import RobotClient | |
from viam.rpc.dial import Credentials, DialOptions | |
from viam.components.board import Board | |
async def connect(): | |
ADDRESS_SECRET = "[ADD YOUR ROBOT ADDRESS HERE. YOU CAN FIND THIS ON THE CONNECT TAB]" | |
PAYLOAD_SECRET = "[PLEASE ADD YOUR SECRET HERE. YOU CAN FIND THIS ON THE CONNECT TAB]" | |
creds = Credentials( |
This file contains 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
from viam.components.arm import ArmClient | |
from viam.components.gripper import GripperClient | |
from viam.proto.api.component.arm import JointPositions | |
from viam.robot.client import RobotClient | |
from viam.components.camera import CameraClient, Camera | |
from viam.services.vision import DetectorConfig, DetectorType, Detection | |
from viam.services.types import ServiceType | |
from viam.rpc.dial import Credentials, DialOptions | |
import time | |
import asyncio |
This file contains 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
-- create a database | |
create database cosmeticshop; | |
-- create a table | |
use cosmeticshop; | |
create table cosmeticshopfunnel | |
( | |
event_time TIMESTAMP, | |
event_type CHAR(18), | |
product_id CHAR(10), |
This file contains 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
/* mySeedScript.js */ | |
// require the necessary libraries | |
const faker = require("faker"); | |
const MongoClient = require("mongodb").MongoClient; | |
function randomIntFromInterval(min, max) { // min and max included | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
async function init() { |
This file contains 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
// MongoDB Playground | |
// To disable this template go to Settings | MongoDB | Use Default Template For Playground. | |
// Make sure you are connected to enable completions and to be able to run a playground. | |
// Use Ctrl+Space inside a snippet or a string literal to trigger completions. | |
// Select the database to use. | |
use('mongodbVSCodePlaygroundDB'); | |
// The drop() command destroys all data from a collection. | |
// Make sure you run it against proper database and collection. |
This file contains 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 MongoClient = require("mongodb").MongoClient; | |
class LinkedList { | |
constructor() {} | |
async init() { | |
const uri = | |
"ATLAS CLUSTER URL HERE"; | |
this.client = new MongoClient(uri, { | |
useNewUrlParser: true, |
This file contains 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
/* | |
Name: Moodlite.ino | |
Created: 27.12.2018 | |
Version: 2.0 | |
AuthorS: Spigot (M.V.), Shiryou & Steve Wagg aka CdRsKuLL | |
License: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
See the GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/gpl.html> | |
Support: Wether you use this project, have learned something from it, or just like it, please consider supporting us on our web site. :) |
This file contains 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 resolveAfter2Seconds = () => { | |
console.log("starting slow promise"); | |
return new Promise(resolve => { | |
setTimeout(() => { | |
resolve(20); | |
console.log("slow promise is done"); | |
}, 2000); | |
}); | |
}; |
NewerOlder