Skip to content

Instantly share code, notes, and snippets.

Mark Wilson mddub

Block or report user

Report or block mddub

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
set nocompatible
" ---------- plugins ---------
execute pathogen#infect()
" Syntastic
let g:syntastic_auto_loc_list=1
let g:syntastic_html_checkers=[]
let g:syntastic_python_checkers = ['flake8', 'pylint', 'mypy']
View -
* * * * * cd /Users/mark/src/hindsight/ && (python screenshot_browser.py > today.html) && /usr/local/bin/phantomjs rasterize.js file:///Users/mark/src/hindsight/today.html todayscreens.png >/dev/null 2>&1
View screenshot_browser.py
import datetime
import os
import re
import sys
from collections import defaultdict
from datetime import timedelta
import sqlite3
from dateutil.parser import parser
View UrchinDataManager.swift
//
// UrchinDataManager.swift
// Loop
//
// Created by Mark Wilson on 8/22/16.
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
//
import Foundation
import CarbKit
@mddub
mddub / listen-app-message.py
Created Aug 16, 2016
no-appmessage-timeout: libpebble2 code
View listen-app-message.py
from threading import Event
from libpebble2.communication import PebbleConnection
from libpebble2.communication.transports.serial import SerialTransport
from libpebble2.protocol.appmessage import AppMessage
from libpebble2.protocol.appmessage import AppMessageACK
from libpebble2.protocol.appmessage import AppMessagePush
pebble = PebbleConnection(SerialTransport("/dev/rfcomm0"))
pebble.connect()
@mddub
mddub / main.c
Created Aug 16, 2016
no-appmessage-timeout: Pebble app
View main.c
#include <pebble.h>
static Window *s_window;
static TextLayer *s_text_layer;
static char s_status[256];
static void clear_status() {
static char buf[16];
time_t now = time(NULL);
strftime(buf, sizeof(buf), "%H:%M:%S", localtime(&now));
View battery_component.c.diff
$ git diff src/battery_component.c
diff --git a/src/battery_component.c b/src/battery_component.c
index 9faf595..1d563b7 100644
--- a/src/battery_component.c
+++ b/src/battery_component.c
@@ -31,6 +31,29 @@ static int battery_icon_id(BatteryChargeState charge_state) {
}
}
+#ifdef PBL_COLOR
View mock-dexcom.py
import json
import random
from flask import Flask, request
app = Flask(__name__)
x = 0
@app.route('/ShareWebServices/Services/General/LoginPublisherAccountByName', methods=['post'])
View basal-set-temp.js.diff
diff --git a/lib/basal-set-temp.js b/lib/basal-set-temp.js
index cf52021..ea0a80e 100644
--- a/lib/basal-set-temp.js
+++ b/lib/basal-set-temp.js
@@ -13,9 +13,22 @@ var setTempBasal = function (rate, duration, profile, rT, currenttemp) {
return rT;
}
- rT.duration = duration;
- rT.rate = Math.round((Math.round(rate / 0.05) * 0.05)*100)/100;
View basal-set-temp.js.diff
diff --git a/lib/basal-set-temp.js b/lib/basal-set-temp.js
index ea0a80e..cf52021 100644
--- a/lib/basal-set-temp.js
+++ b/lib/basal-set-temp.js
@@ -13,22 +13,9 @@ var setTempBasal = function (rate, duration, profile, rT, currenttemp) {
return rT;
}
- var suggestedRate = Math.round((Math.round(rate / 0.05) * 0.05)*100)/100;
- if (suggestedRate === profile.current_basal) {
You can’t perform that action at this time.