Skip to content

Instantly share code, notes, and snippets.

pref = "#{RAILS_ROOT}/public"
base = "/defs/#{OpenWFE.ensure_for_filename(self.name)}"
i = ''
fn = pref + base + i.to_s + '.def'
Adhearsion = RESTfulAdhearsion.new(:host => "localhost", :port => 5000)
options = { :channel => "IAX2/outbound/6472953634",
:priority => 1,
:context => "outbound"}
puts Adhearsion.originate options
asdf
:
[default]
exten => _X.,1,AGI(agi://localhost)
exten => _X.,n,Hangup
require File.dirname(__FILE__) + '/stories/stories_helper'
def build_time(days_ago, hour = 0, minute = 0, second = 0)
return days_ago.to_i.days.ago.change({:hour => hour.to_i, :min => minute.to_i, :sec => second.to_i})
end
context "Person took readings more than 30 days ago, and only now got around to sending them" do
before(:all) do
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
IRB.conf[:AUTO_INDENT]=true
require 'rubygems'
require 'wirble'
Wirble.init
initialization do
HoptoadNotifier.configure do |config|
config.api_key = COMPONENTS.hoptoad_notifier['api_key']
end
end
methods_for :dialplan do
def watched_by_hoptoad(args = nil, &block)
begin
yield
register_participant 'build_adherence_predicates' do |workitem|
# We do this separately, since we only care about
# its presence, and not its value
p = Patient.find workitem['patient_id']
[:bp, :pulse, :symptom, :weight].each do |parameter|
if (p.send("#{parameter}_readings").morning.during(Time.last(7.days)) == 0)
workitem["#{parameter}_today"] = 'no'
else
workitem["#{parameter}_today"] = 'yes'
\|/ \|/ DSL
| <- 802.11g (matnet) | <- 802.11g (matnet) |
express extreme wrt54g (no wireless)
| <- wired | <- wired | <- wired
| | |
------------------------------------------------------------