Skip to content

Instantly share code, notes, and snippets.

import json
import random
from flask import Flask, request
app = Flask(__name__)
x = 0
@app.route('/ShareWebServices/Services/General/LoginPublisherAccountByName', methods=['post'])
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']
@mddub
mddub / -
Created February 12, 2017 01:43
* * * * * 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
import datetime
import os
import re
import sys
from collections import defaultdict
from datetime import timedelta
import sqlite3
from dateutil.parser import parser
//
// 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 August 16, 2016 03:34
no-appmessage-timeout: libpebble2 code
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 August 16, 2016 03:17
no-appmessage-timeout: Pebble app
#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));
$ 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
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;
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) {