Skip to content

Instantly share code, notes, and snippets.

View luigibrancati's full-sized avatar
🏠
Working from home

Luigi Brancati luigibrancati

🏠
Working from home
View GitHub Profile
@gmag11
gmag11 / mqtt_ssl_idf.ino
Last active January 11, 2025 08:10
Secure MQTT connection to broker with ESP32 and internal IDF mqtt client library
#include "Arduino.h"
#include <WiFi.h>
#include "esp_log.h"
#include "esp_system.h"
#include "esp_event.h"
#include "mqtt_client.h"
#define SECURE_MQTT // Comment this line if you are not using MQTT over SSL
#ifdef SECURE_MQTT
@mkaranasou
mkaranasou / python_yaml_environment_variables.py
Last active March 1, 2026 09:25
Python Load a yaml configuration file and resolve any environment variables
import os
import re
import yaml
def parse_config(path=None, data=None, tag='!ENV'):
"""
Load a yaml configuration file and resolve any environment variables
The environment variables must have !ENV before them and be in this format
to be parsed: ${VAR_NAME}.