Skip to content

Instantly share code, notes, and snippets.

View mikekilpatrick's full-sized avatar

mikekilpatrick

View GitHub Profile
@mikekilpatrick
mikekilpatrick / hdc1008.py
Created May 11, 2022 16:30 — forked from danesparza/hdc1008.py
Python code to read temperature and humidity from an HDC1008 sensor on a Raspberry Pi
#!/usr/bin/python
import struct, array, time, io, fcntl
I2C_SLAVE=0x0703
# find with sudo i2cdetect -y 1
HDC1008_ADDR = 0x40
bus=1
fr = io.open("/dev/i2c-"+str(bus), "rb", buffering=0)
@mikekilpatrick
mikekilpatrick / hdc1008.py
Created May 11, 2022 16:30 — forked from danesparza/hdc1008.py
Python code to read temperature and humidity from an HDC1008 sensor on a Raspberry Pi
#!/usr/bin/python
import struct, array, time, io, fcntl
I2C_SLAVE=0x0703
# find with sudo i2cdetect -y 1
HDC1008_ADDR = 0x40
bus=1
fr = io.open("/dev/i2c-"+str(bus), "rb", buffering=0)
from math import log
from flask import Flask, render_template
from sense_hat import SenseHat
app = Flask(__name__)
def weather():
sense = SenseHat()
sense.clear()
@mikekilpatrick
mikekilpatrick / wget.sh
Created January 4, 2021 23:57 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.