Skip to content

Instantly share code, notes, and snippets.

BOLUS COMPARISON #1 & #2
========================
#1 via Loop iOS GUI
===================
13:12
BolusNormalPumpEvent(length: 13, rawData: 13 bytes, timestamp: calendar: gregorian (fixed) year: 2016 month: 10 day: 27 hour: 13 minute: 12 second: 41 isLeapMonth: false , unabsorbedInsulinRecord: nil, amount: 0.10000000000000001, programmed: 0.10000000000000001, unabsorbedInsulinTotal: 0.10000000000000001, type: MinimedKit.BolusNormalPumpEvent.BolusType.Normal, duration: 0.0, deliveryUnitsPerMinute: 1.5)
@bfaloona
bfaloona / operation.md
Last active August 29, 2016 16:09
OpenAPS Operation Notes (gist test)

Instructions

If you build a DIY OpenAPS implementation, you might find these notes useful for day to day operation and troubleshooting.

You can copy and modify this document to reflect the details of your OpenAPS implementation (both hardware and software).

Treat this document as a guide that helps you provide details for each of the topics below. The information and instructions should be as detailed or generalized as suits the T1D and those operating the OpenAPS implementation.

Overview

@bfaloona
bfaloona / content_length.ru
Last active January 14, 2016 22:46
Several simple Rack Applications and Middlewares
use Rack::ContentLength
run Proc.new { |env|
[200, {}, ['Hello from Rack']]
}
@bfaloona
bfaloona / fast_source
Created February 27, 2012 06:38
Simple binary search on a faux logfile
class FastSource
def open(string)
Struct.new("Line", :id, :msg)
@data = []
string.each do |line|
id, msg = line.split(',')
@data << Struct::Line.new(id.strip.to_i, msg.chomp)
end
@data
end
@bfaloona
bfaloona / gist:834214
Created February 18, 2011 19:07
Cucumber bug 701
# features/bug701_rerun_scenario_outline.feature
#
# To repro bug 701, run:
# cucumber features/bug701_rerun_scenario_outline.feature -f rerun -o rerun.txt
# then:
# cat rerun.txt
# I expect the file to have two failing references, but the scenario outline is NOT referenced at all.
#
Feature: Bug701 - Rerun formatter does not include failures that occur in scenario outline examples
@bfaloona
bfaloona / gist:710107
Created November 22, 2010 15:26
Access to WatirCraft Methods from WatirCraft page classes
# lib/methods/versions.rb
module MyProject
module Methods
def app_version
browser.url.match(/\/myproject\/([0-9]{2})\//)[1].to_i
end
end
end
# bug 672 repros when cucumber is called with line number on feature below, e.g.:
$ cucumber features/failing_before_hook_in_background.feature:4
# env.rb
Before('@bug672') do |scenario|
raise Exception, "Exception from before hook tagged @bug672"
end
# features/failing_before_hook_in_background.feature
require 'uwchat'
module UWChat
class ServerCommand
# ...
end
end
>> require 'drb'
=> true
>> client = DRbObject.new( nil, 'druby://:1234')
=> #<DRb::DRbObject:0x1016c8c78 @ref=nil, @uri="druby://:1234">
>> client.connection
=> 1
>> client.cookbook do
?> return true
>> end
DRb::DRbConnError: DRb::DRbServerNotFound