Skip to content

Instantly share code, notes, and snippets.

View stephen304's full-sized avatar
:shipit:

Stephen Smith stephen304

:shipit:
View GitHub Profile
@balloob
balloob / MQTT_ESP8266_temperature_humidity.ino
Created June 20, 2016 04:11
Sketch for the ESP8266 to publish temperature and humidity values received from a DHT22 to MQTT
// Get ESP8266 going with Arduino IDE
// - https://github.com/esp8266/Arduino#installing-with-boards-manager
// Required libraries (sketch -> include library -> manage libraries)
// - PubSubClient by Nick ‘O Leary
// - DHT sensor library by Adafruit
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <DHT.h>
alignment top_left
background yes
border_width 1
cpu_avg_samples 2
default_color 9a875f
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders no
draw_outline no
@adammw
adammw / tt2srt.py
Created April 12, 2011 09:44
Timed Text Captions to SRT Subtitles converter script
# Usage: python tt2srt.py source.xml output.srt
from xml.dom.minidom import parse
import sys
i=1
dom = parse(sys.argv[1])
out = open(sys.argv[2], 'w')
body = dom.getElementsByTagName("body")[0]
paras = body.getElementsByTagName("p")
for para in paras: