Skip to content

Instantly share code, notes, and snippets.

View howtodowtle's full-sized avatar
⛰️

Alexander Jakob Dautel howtodowtle

⛰️
View GitHub Profile
@howtodowtle
howtodowtle / oura2beeminder.rb
Last active February 11, 2022 08:12
Send Oura bedtime to Beeminder as "hours before midnight"
#! /usr/bin/ruby
# frozen_string_literal: true
# Original script: Bee from beeminder --> https://forum.beeminder.com/t/oura-integration/9592
# A script to fetch my bedtime from Oura and update my beeminder goal
# If run with no arguments it fetches the last 5 days from Oura. Does not update existing datapoints.
require 'httparty'
OURA_TOKEN = 'YOUR_OURA_PERSONAL_ACCESS_TOKEN'
@howtodowtle
howtodowtle / stryd_calibration.py
Last active April 21, 2021 21:49
Stryd calibration algorithm
import math
def calibrate_stryd(stryd_distance: float, real_distance: float,
current_calibration_factor: float = 100.,
max_deviation: float = 2., max_weight: float = 0.4444, verbose: bool = True):
"""Calculates the new Stryd calibration factor given a distance measured by Stryd vs in reality (in m).
All calibration factors and the deviation are given with baseline 100 (as in Garmin watches).
`max_weight` is in [0., 1.] and determines the maximum weight of the new data.
Rules: