Skip to content

Instantly share code, notes, and snippets.

Avatar

Dexter LaBora dexterlabora

View GitHub Profile
@dexterlabora
dexterlabora / v0-v1-path-operations-diff.json
Created Sep 4, 2020
Meraki API v0-v1-path-operations-diff.json
View v0-v1-path-operations-diff.json
[
{
"oldPath": "/devices/{serial}/camera/qualityAndRetentionSettings",
"newPath": "/devices/{serial}/camera/qualityAndRetention",
"oldOperations": [
"getDeviceCameraQualityAndRetentionSettings",
"updateDeviceCameraQualityAndRetentionSettings"
],
"newOperations": [
"getDeviceCameraQualityAndRetention",
@dexterlabora
dexterlabora / reddit-power-temp-flows.json
Created Jul 28, 2020
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.
View reddit-power-temp-flows.json
[
{
"id": "8d3e6c8e.8cbc9",
"type": "inject",
"z": "e941d247.46185",
"name": "51%",
"props": [
{
"p": "payload"
},
@dexterlabora
dexterlabora / jsonata.txt
Created Jul 21, 2020
JSONata - Format OpenAPI Spec JSON for Vue V-Swagger component
View jsonata.txt
(
/*
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 / mr-mqtt-nr-simulator.json
Created Aug 21, 2019
A simulation of WiFi and BLE probes and MQTT communication network.
View mr-mqtt-nr-simulator.json
[
{
"id": "c100fe2a.cb152",
"type": "debug",
"z": "90fbc492.9c31f8",
"name": "Broker",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
@dexterlabora
dexterlabora / esp8266-sniffer
Created Aug 7, 2019
A fork of esp8266-sniffer to pipe probe requests the serial port in JSON format to be easily used with Node-RED, etc.
View esp8266-sniffer
#include <ArduinoJson.h>
#include <iostream>
#include <ESP8266WiFi.h> // added this
#include <ESP8266HTTPClient.h> // added this
const char* serial = "YYYY-YYYY-YYYY"; // fake AP serial
const char* networkId = "N_99999999999"; // fake network ID
const float txPower = 20.5; // power in dBm (0 - 20.5)
@dexterlabora
dexterlabora / parsePathParams.js
Created Apr 12, 2019
Regex to replace URL path params with values
View parsePathParams.js
var path = '/network/{id}/device/{serial}';
params = {
id:"123456",
serial: "abcd-abcd-abcd"
}
var paramNames = Object.keys(params);
console.log('paramNames', paramNames);
@dexterlabora
dexterlabora / vue.config.js
Created Apr 1, 2019
Meraki API proxy config for VueJS with Webpack
View vue.config.js
module.exports = {
devServer: {
proxy: {
"/api/*": {
target: "https://api.meraki.com/api/v0",
secure: false,
changeOrigin: true,
pathRewrite: {
"^/api": ""
},
@dexterlabora
dexterlabora / snow-meraki-webhook-alerts.js
Created Mar 18, 2019
ServiceNow - Meraki Webhook Alerts
View snow-meraki-webhook-alerts.js
(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
// Parse Meraki Alerts Webhook Data
var requestBody = request.body;
var requestString = requestBody.dataString;
var requestParsed = {};
requestParsed = JSON.parse(requestString);
var merakiAlert = requestParsed;
// Create SNOW Incident
View node-red-meraki-alerts
[
{
"id": "6b02c4a0.a0d1ac",
"type": "tab",
"label": "Alerts",
"disabled": false,
"info": ""
},
{
"id": "def605c1.7fb328",
View node-red-mvmqttdemo.json
[
{
"id": "fc8601c3.25e5b",
"type": "tab",
"label": "MV MQTT",
"disabled": false,
"info": ""
},
{
"id": "8a8e0f9e.ea00c",
You can’t perform that action at this time.