Skip to content

Instantly share code, notes, and snippets.

@jonblack
jonblack / README.md
Created February 7, 2024 08:30
Garmin HRV/sleep Plot

Garmin Connect only supports showing a maximum 4-week plot of HRV data. This script scrapes HRV and sleep data and plots it on a single graph, making it much easier to see the trend over time.

In order for the script to work, you need to provide the correct values for the Authorization and Cookie headers. To get these:

  • Log in to Garmin Connect and navigate to the HRV status report
  • Open the browser developer tools and select the network tab
  • In the HRV status report, click to a previous period. This will cause a network request to update the report
  • In the developer tools, click on the network request and look for the request header.
@jonblack
jonblack / file.rb
Last active November 15, 2019 21:59
keybase.md
### Keybase proof
I hereby claim:
* I am jonblack on github.
* I am jonblack (https://keybase.io/jonblack) on keybase.
* I have a public key ASA7Np1e3MTaf6MrhICPXGWH3Qq3Jz8Ugq12SHiqeUHTDwo
To claim this, I am signing this object:
@jonblack
jonblack / components.dialog-step-one.js
Last active April 19, 2017 18:31
Bulma Liquid Tether
import Ember from 'ember';
export default Ember.Component.extend({
});
@jonblack
jonblack / components.dialog-step-one.js
Last active November 14, 2017 19:20
Elsewhere Liquid Dialog Steps
import Ember from 'ember';
export default Ember.Component.extend({
});
@jonblack
jonblack / core_dump_test.sh
Created March 9, 2017 08:34
Test core dump creation
#!/bin/bash
/usr/bin/g++ -x c++ - -o crash -g <<SOURCE
int main(int argc, const char **argv)
{
int *p = 0;
int r = *p + 1;
return 0;
}
@jonblack
jonblack / main.rs
Created January 21, 2016 15:30
Parse XML using xml-rs
extern crate xml;
use std::fs::File;
use std::io::BufReader;
use xml::reader::{EventReader, XmlEvent};
struct Book {
title: String,
author: String,
@jonblack
jonblack / md_inline_to_ref.py
Created May 22, 2014 16:09
Convert inline links to reference links in markdown
import os
import re
import sys
RE_MD_INLINE_LINK = re.compile(' \[(?P<name>[\w -_]*)\]\((?P<link>[\w \-/\.:]*)\)')
if __name__ == "__main__":
src_path = sys.argv[1]
@jonblack
jonblack / useful_commands.sh
Created May 15, 2014 08:28
Useful shell commands for manipulating source code
# Remove trailing whitespace from all files with a given extension
find . -name "*.h" | xargs sed -i 's/[ \t]*$//'
# Convert tabs to spaces in all files with a given extension
find . -name "*.h" | xargs sed -i 's/\t/ /g'
@jonblack
jonblack / logging_info.py
Last active August 29, 2015 14:01
Outputs the names and levels of all configured loggers
import logging
_log = logging.getLogger(__name__)
for logger_name in logging.Logger.manager.loggerDict.keys():
print logger_name, logging.getLevelName(logging.getLogger(logger_name).level)