Skip to content

Instantly share code, notes, and snippets.

@dexterlabora
dexterlabora / jsonata.txt
Created July 21, 2020 21:08
JSONata - Format OpenAPI Spec JSON for Vue V-Swagger component
(
/*
JSONata expression to:
Format OpenAPI Spec JSON for Vue V-Swagger component
https://www.npmjs.com/package/v-swagger
*/
$requestArray := $.paths.*#$pi.*#$i.{
@dexterlabora
dexterlabora / reddit-power-temp-flows.json
Created July 28, 2020 17:24
Is basement humidity above 50%? Is current power draw in Watts below 5.0 on dehumidfier? Only if both of those are true, then trigger the next step in the flow.
[
{
"id": "8d3e6c8e.8cbc9",
"type": "inject",
"z": "e941d247.46185",
"name": "51%",
"props": [
{
"p": "payload"
},
@dexterlabora
dexterlabora / v0-v1-path-operations-diff.json
Created September 4, 2020 20:24
Meraki API v0-v1-path-operations-diff.json
[
{
"oldPath": "/devices/{serial}/camera/qualityAndRetentionSettings",
"newPath": "/devices/{serial}/camera/qualityAndRetention",
"oldOperations": [
"getDeviceCameraQualityAndRetentionSettings",
"updateDeviceCameraQualityAndRetentionSettings"
],
"newOperations": [
"getDeviceCameraQualityAndRetention",
@dexterlabora
dexterlabora / jsonata-openapi-parse-ops-paths.txt
Created February 12, 2021 11:38
JSONata - Parse Open API v2 Spec by Path, Operation, Description and Tags
/* OAS Path Ops and Tags */
(
$.paths.*#$index.**.operationId.{
/*"pathIndex": $index,*/
"path": $keys($$.paths)[$index],
"operationid": %.operationId,
"description": %.description,
"tags":%.tags
};
)
@dexterlabora
dexterlabora / merakiFetchReport.gs
Created April 25, 2022 19:02
An add-on custom function to call a Meraki API and shape the data to fit a Google Sheet.
/**
* Fetches Meraki API data and formats the JSON data into Google Sheet format
* @param url url to pull json data from
* @param apiKey API key for authorization
* @param title The title text to display in the cell
* @param refresh Triggers a refresh of report when changed. Cannot use now() functions, so a helper "Refresh Reports" button will update a hidden _meraki_tools settings sheet to set a time, triggering the function to re-evaluate. You can optionaly set a Trigger to call the refreshReports function on a schedule.
* @return Google Sheet data
* @customfunction
@dexterlabora
dexterlabora / meraki-mqtt-v1-asyncapi.yaml
Created April 28, 2022 14:02
DEV --- The is just a TEST schema for Meraki MQTT data.
asyncapi: '2.3.0'
info:
title: Meraki MQTT API
version: '1.0.0'
description: |
The Meraki MQTT service enables real-time telemetry from your network devices.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0