Skip to content

Instantly share code, notes, and snippets.

# Now to pimp out our prompt
NOCOLOR="\[\033[0m\]"
BAR="----"
BLK="\[\033[0;30m\]" ; BLK1="\[\033[1;30m\]" #dark grey
RED="\[\033[0;31m\]" ; RED1="\[\033[1;31m\]"
GRN="\[\033[0;32m\]" ; GRN1="\[\033[1;32m\]"
YEL="\[\033[0;33m\]" ; YEL1="\[\033[1;33m\]"
BLU="\[\033[0;34m\]" ; BLU1="\[\033[1;34m\]"
PUR="\[\033[0;35m\]" ; PUR1="\[\033[1;35m\]"
[alias]
st = status
ci = commit
co = checkout
br = branch
ca = commit -av
lo = log --graph
undo = reset --hard
[color]
branch = auto
#!/usr/bin/ruby
require 'net/imap'
class ExchangeCalendar
def initialize(servername, user, password)
@imap = Net::IMAP.new(servername)
@imap.login(user, password)
@imap.examine('Calendar')
end
\|/ \|/ DSL
| <- 802.11g (matnet) | <- 802.11g (matnet) |
express extreme wrt54g (no wireless)
| <- wired | <- wired | <- wired
| | |
------------------------------------------------------------
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'
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
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
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
[default]
exten => _X.,1,AGI(agi://localhost)
exten => _X.,n,Hangup