Skip to content

Instantly share code, notes, and snippets.

@bewest
bewest / nightscout_sustainability_pledge.md
Last active September 20, 2023 01:25
nightscout sustainability pledge

The Nightscout Sustainability Pledge

Towards an enduring Nightscout

The Nightscout ecosystem thrives on the collective efforts of a wide range of contributors, from independent users to large distribution entities. Each role within this ecosystem has unique responsibilities and opportunities to contribute towards the project's sustainability. Recognizing these distinct roles and their implications is crucial for ensuring the long-term growth and success of Nightscout.

  1. Distributors of Nightscout:
  • Distributors play a key role in increasing the reach of Nightscout. Their commitments focus on ensuring safe distribution, regulatory compliance, and providing sustaining support.
  • Distributors prioritize user safety and commit to staying updated with the latest releases and recommendations from the Nightscout core team.
  • They understand the importance of regulatory and legal compliance, making efforts to align with global standards and adapting to regional specifics.
@bewest
bewest / one-devicestatus.json
Created May 5, 2023 00:01
nightscout data examples, one of each core type.
{
"_id": "64542c86cb9fdd081dd8dec4",
"pump": {
"suspended": false,
"bolusing": false,
"manufacturer": "Medtronic",
"clock": "2023-05-04T22:07:02Z",
"reservoir": 146.4,
"secondsFromGMT": -25200,
"pumpID": "208850",
// This does practically the same thing that TryFrom<&str> does.
// Additionally, upon implementing FromStr, you can use the `parse` method
// on strings to generate an object of the implementor type.
// You can read more about it at https://doc.rust-lang.org/std/str/trait.FromStr.html
use std::str::FromStr;
#[derive(Debug)]
struct Person {
name: String,
age: usize,

Nightscout Connect

Use xstate to create generic control flow and logic for well behaved, session consuming http agents that sync from a third party data source and then uploads the data to Nightscout.

@bewest
bewest / libre-batch-csv-to-nightscout.md
Last active May 19, 2021 21:54
libre csv to nightscout json

Convert CSV From Libre into NS-friendly json

Something like this.

@bewest
bewest / machine.js
Last active February 5, 2021 17:21
Generated by XState Viz: https://xstate.js.org/viz
/*
Our client is expected to access a web service on a regular
interval as part of a polling activity. The access itself
requires a Bearer token, which can sometimes be renewed.
If it cannot be renewed, a new one must be created by
going through a sequence of steps.
*/
var refreshingBearerTokenFetchMachine = Machine({
id: 'RefreshingTokenAccessFetchMachine',
@bewest
bewest / lookup-examples.log
Created August 22, 2020 16:13
using consul with auth_request as ingress multiplexer
+ curl -siv localhost:2829/scheduled/consul/cluster/aaa/
+ json
* Trying ::1:2829...
* TCP_NODELAY set
* Connected to localhost (::1) port 2829 (#0)
> GET /scheduled/consul/cluster/aaa/ HTTP/1.1
> Host: localhost:2829
> User-Agent: curl/7.65.3
> Accept: */*
>

Medtronic SSO Resource Ownership

Get Access Code

Select Locale

GET https://carelink.minimed.eu/patient/sso/login?country=gb&lang=en
@bewest
bewest / README.md
Last active February 20, 2020 20:10
glucose sonification

Glucose Sonification

demo

code

Sonification is the use of non-speech audio to convey information or perceptualize data.[1] Auditory perception has advantages in temporal, spatial, amplitude, and frequency resolution that open possibilities as an alternative or complement to visualization techniques.

sample