Skip to content

Instantly share code, notes, and snippets.

@jussih
jussih / sports-tracker-takeout.py
Created May 28, 2023 14:11
Sports Tracker takeout
import os
import requests
import sys
from dataclasses import dataclass
from datetime import datetime
from typing import List, Optional
@dataclass
class Workout:
{
"id": 11,
"type": "Router",
"ieeeAddr": "0x00124b001f79d7ea",
"nwkAddr": 52541,
"manufId": 0,
"manufName": "GLEDOPTO",
"powerSource": "Mains (single phase)",
"modelId": "GL-C-007",
"epList": [
@jussih
jussih / mhz19_zero_calibration.ino
Last active May 4, 2020 20:00
MH-Z19 carbon dioxide sensor zero point calibration
/*
Simple calibration run for the MH-Z19 co2 sensor. Usable with Arduino IDE and tested with an ESP8266 NodeMCU clone.
Uses this MH-Z19 library: https://github.com/WifWaf/MH-Z19
1. Connect the sensor to pins 4 and 5 in your board (board TX pin to sensor RX pin and vice versa)
2. Flash this to the board
3. Move the board and sensor outside, the ideal conditions would be 400PPM co2 concentration
4. Wait 30 minutes for the calibration to happen
Disable autocalibration in your production firmware.
@jussih
jussih / server.py
Created January 8, 2020 07:41
Python simple http server
# -*- coding: utf-8 -*-
import argparse
import http.server
import socketserver
PORT = 8080
def get_handler_class(dir=None):
class Handler(http.server.SimpleHTTPRequestHandler):

Keybase proof

I hereby claim:

  • I am jussih on github.
  • I am jussih (https://keybase.io/jussih) on keybase.
  • I have a public key ASDaHnnx-WREpHMOmO-nmZY9R0LI4VUkLLRbeyTtgH8XfQo

To claim this, I am signing this object: