Skip to content

Instantly share code, notes, and snippets.

View Abathargh's full-sized avatar

Gianmarco Abathargh

View GitHub Profile
"""
Installare le dipendenze tramite:
pip3 install requests audioop pyaudio
ed eseguire:
python3 lamp_control.py
"""
import requests
import audioop
@Abathargh
Abathargh / mqtt_test.go
Created April 29, 2020 18:31
Esempio di Client MQTT implementato in go tramite paho.mqtt.golang
package main
import (
"fmt"
"github.com/eclipse/paho.mqtt.golang"
"log"
"os"
"os/signal"
"syscall"
)
@Abathargh
Abathargh / esempi_iter_gen.py
Created April 22, 2020 23:10
Esempi trattati all'interno dell'articolo di antima.it su iteratori e generatori http://antima.it/elementi-di-python-iteratori-e-generatori/
class ListaConcatenata:
class Nodo:
val = None
prossimo = None
def __init__(self):
self.testa = None
def aggiungi(self, n_val):
if self.testa is None:
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
from threading import Lock
from paho.mqtt.client import Client
CLIENTID = "Mediator"
HOST = "localhost"
BASETOPIC = "actuator"
SUBTOPIC = "sensor/#"
table = dict()
mutex = Lock()