This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import log | |
| from flask import Flask, render_template | |
| from sense_hat import SenseHat | |
| app = Flask(__name__) | |
| def weather(): | |
| sense = SenseHat() | |
| sense.clear() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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. |