Skip to content

Instantly share code, notes, and snippets.

View wpeterson's full-sized avatar

Winfield Peterson wpeterson

View GitHub Profile
PROs in the Community - Cris
Delete Orphaned Symptoms/Tx/Purposes - Jeffrey
Sort Forum by Topic Creation - James
Track CPTs by Condition - Jeffrey
Link Treatments to Condition - Ben & Keenan
Flash Doctor Visit Sheet - Doug
Condition Admin Improvements - Keenan
Community Engagement Reminders - Michael
CDN - Winfield
Instant Mood Everywhere - Amy
class Foo
def fail
raise "I Can't Code"
end
end
@wpeterson
wpeterson / coding_project.rb
Created October 18, 2010 00:22
Here's Bob's Coding Challenge
state_machine :state, :initial => :applied do
before_transition(any => :applied) {|r, t| r.applied_at = Time.now }
before_transition(any => :screened) {|r, t| r.screened_at = Time.now }
before_transition(any => :interview) {|r, t| r.interview_at = Time.now }
before_transition(any => :rejected) {|r, t| r.rejected_at = Time.now }
before_transition(any => :hired) {|r, t| r.hired_at = Time.now }
before_transition(any => :disabled) {|r, t| r.disabled_at = Time.now }
after_transition(any => :hired) {|r, t| r.update_attribute(:kind, 'Employee')}
acceptcheck
Designer: FatCow Web Hosting
License:Creative Commons (Attribution 3.0 United States)
Size: 32 x 32 px
Icon set: Farm-fresh ( Show all icons in this icon set)
http://www.mricons.com/icon/118067/32/accept-check-icon http://www.fatcow.com/
source 'http://rubygems.org'
gem 'rails', '3.0.0'
# Deploy with Capistrano
gem 'capistrano'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
Leaders Work - Jeffrey & Michael, Adam
PLM in Motion - Cris & Winfield
Condition Info - Mav, Michael, Jeffrey, Cris, and Adam
Disease DMT Tracking - Keenan
Drug Safety Outcome Search - Michael
Treatment Brand Names - Michael
Currently Taking Patient List - Michael
MedDRA Upgrade - James
Flash Charting, maybe PD charts - Doug
PV Performance/Background - Mav
start_date = 5.years.ago.to_date
end_date = Date.today
manufacturer = Manufacturer.find_by_name! 'UCB Inc.'
search_opts = {'start_date' => start_date, 'end_date' => end_date, 'manufacturer' => manufacturer}
puts "Line Listing for #{search_opts.inspect}..."
search = Search.new(search_opts)
events = DrugSafety::Event.for_line_listing_report(search)
puts "Found #{events.size} events."
# Performance benchmark of native Ruby MD5 digest vs. shelling out
# to openssl md5 utility. Benchmark clearly shows shelling out is
# massively slower, as you might expect.
#
# [master ~/src/cloudfront_asset_host]$> ruby md5_benchmark.rb
# Openssl: 0.110000 0.650000 5.220000 ( 7.547728)
# Native: 0.020000 0.010000 0.030000 ( 0.031182)
require 'benchmark'
require 'digest/md5'
Survey Validations - James
Yellow Prompts: Reminders & Surveys - Mav
Sympom Merges - Ben/Jeffrey?
Suspended Surveys - Winfield
Survey Invite Tracking - Keenan
Survey Emails - Keenan
Survey Reminders - Jeffrey
Fibro Flash Charts - Doug
<VirtualHost *:80>
ServerName local.plm
ServerAlias www.local.plm
DocumentRoot /Users/winfield/src/plm-website/public
ExpiresDefault "access plus 1 day"
ErrorDocument 401 /500.html
ErrorDocument 403 /500.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html