Skip to content

Instantly share code, notes, and snippets.

View sulkaharo's full-sized avatar

Sulka Haro sulkaharo

View GitHub Profile
@sulkaharo
sulkaharo / gist:6337f964da93f19c1a5783cd6d888b81
Last active January 22, 2020 09:33
Super duper simple array performance measure
<!DOCTYPE html>
<html>
<head>
<title>
Express</title>
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
@sulkaharo
sulkaharo / release.md
Last active July 19, 2019 07:16
Nightscout 0.12.0 release notes draft

Release 0.12.0 is here!

Most important changes:

  • The release improves the packaging and data loading, so the web view now loads faster and should consume less resources in the browser
  • Guardian Connect now supports the EU servers (set MMCONNECT_SERVER=EU in site settings, among other parameters)
  • The REST API now normalizes dates in the data to UTC. This might cause some data loading to misbehave for up to 12 hours after updating the site (the number of hours between your local time and UTC). If you're using systems that syncronizes data both ways with Nightscout (such as a DIY artificial pancreas), please keep a close eye to how everything is behaving after you upgrade.

Full list:

@sulkaharo
sulkaharo / gist:6ea3cdb896b237384e0c57599ecde5d1
Last active February 2, 2019 15:36
Base setup for Mongo
The default Mongo installation has SECURITY DISABLED. This is a critical issue to fix, because if you don't create accounts and enable security as described below, anyone in the Internet can log into your server and delete your data.
Create an admin user for the server:
Start Mongo by typing “mongo” on the command line, then type following commands on Mongo prompt:
use admin
db.createUser( { user: "admin",
@sulkaharo
sulkaharo / start.sh
Created November 17, 2017 06:38
upstart for nightscout
#!upstart
#
# An example upstart script for running a Node.js process as a service
# using Forever as the process monitor. For more configuration options
# associated with Forever, see: https://github.com/nodejitsu/forever
#
# You will need to set the environment variables noted below to conform to
# your use case, and should change the description.
#
description "Start Nightscout using Node"
@sulkaharo
sulkaharo / gist:74bf4157ef73c302cc6d
Created June 22, 2015 16:05
cgm-remote-monitor data loading notes

Problem

  • Server uses too much RAM, holds onto too much data
  • Data in-memory format inefficient, a lot of data that's not a string loaded as string
  • Clients can insert data directly into Mongo, so server can't load a delta with current data structures
    • Server now loads full 2+ days of data every time to ensure all data is loaded
    • Loading just the changed / inserted data would make the record processing significantly more efficient in terms of CPU and memory use

Potential solution