This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select prop_value from participant_data where participant_id = 1394 and prop_key = 'core_2_preferred_bedtime'; | |
+------------+ | |
| prop_value | | |
+------------+ | |
| 4:00 am | | |
+------------+ | |
1 row in set (0.04 sec) | |
mysql> start transaction; | |
Query OK, 0 rows affected (0.00 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> Task.last | |
=> #<Task createddate: nil, whatid: "0013000000w98bSAAQ", whoid: nil, subject: "search_for_me", isdeleted: nil, id: 938828, sfid: nil, description: "TAM call - search_for_me", _c5_source: nil, lastmodifieddate: nil, accountid: nil, ownerid: nil> | |
irb(main):002:0> | |
Results in: | |
2014-09-16 3:26:07 PM Salesforce error: 'Server raised fault: 'INVALID_CROSS_REFERENCE_KEY: invalid cross reference id'' 21 task 938828 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
actionmailer (2.3.14) | |
actionpack (= 2.3.14) | |
actionpack (2.3.14) | |
activesupport (= 2.3.14) | |
rack (~> 1.1.0) | |
activerecord (2.3.14) | |
activesupport (= 2.3.14) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# routes.rb | |
ActionController::Routing::Routes.draw do |map| | |
map.connect 'saml', :controller => 'saml', :action => 'init' | |
map.connect '/saml/:action', :controller => 'saml' | |
... | |
# Gemfile | |
gem 'ruby-saml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; <<>> DiG 9.8.3-P1 <<>> short + app.shuti.me | |
;; global options: +cmd | |
;; connection timed out; no servers could be reached | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47037 | |
;; flags: qr rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 | |
;; WARNING: recursion requested but not available | |
;; QUESTION SECTION: | |
;app.shuti.me. IN A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -u "SleepMed_Admin:czd*ua292" http://107.22.212.178/wasabi/participants/summary/1387 | |
Notes: | |
You have to use your admin credentials for this invocation. You have to use the participant login, not the pid. You should see a response like the following: | |
Content-Length: 1398 | |
Content-Type: application/json; charset=utf-8 | |
Date: Wed, 27 Aug 2014 23:13:19 GMT | |
ETag: "91a10a4e45145774e8f56ac33ba4f046" | |
Server: Apache/2.2.22 (Ubuntu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -u 'api_uid:api_pw' --data "[email protected]&AddressCity=SomeCity&AddressStreet1=Main&AdressRegion=VA&TimeZone=EST&CustomerPhone=555-555-5555&CustomerLastName=Smith&CustomerFirstName=John&[email protected]&HeardAbout=yep&OrderReference=1&OrderProductName=widget&ClinicalAccessCode=CCSD2013&OrderReferrer=bob&CustomerSleepPhysician=Dr.%20Who&CustomerBirthDate=27&CustomerBirthMonth=01" http://107.22.212.178/callback/activate | |
Results in: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<participant> | |
<account-type>None</account-type> | |
<created-at type="datetime">2014-08-23T18:42:48+00:00</created-at> | |
<deleted type="boolean">false</deleted> | |
<detailed-logging type="boolean" nil="true"></detailed-logging> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Helpers | |
# Conventient way to setup filesystem attachment uploading when in dev/testing | |
# and use S3 otherwise | |
module AssetStorage | |
def self.included(within) | |
within.class_eval do | |
extend ClassMethods | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Asset < ActiveRecord::Base | |
include Helpers::AssetStorage | |
before_validation :clear_asset | |
belongs_to :ad, :polymorphic => true | |
stores_file_as :image, | |
:styles => {:micro => "75x43", :thumb => "128x95", :medium => "300x300", :large => "500x500"} | |
validates_attachment_presence :image |