Skip to content

Instantly share code, notes, and snippets.

Avatar

Graham Melcher melcher

View GitHub Profile
We couldn’t find that file to show.
@melcher
melcher / interview-notes.md
Created May 29, 2017
December Labs - Agustin Interview Notes
View interview-notes.md

Api Docs

Show Invoice

URL

/practices/:practice_uid/invoices/:invoice_uid

Method

GET

URL params

@melcher
melcher / request_helper.rb
Created Feb 6, 2014
Adds support for OPTIONS verb testing in rspec-rails Request (integration) tests
View request_helper.rb
module RequestHelper
#...
# Add support for testing `options` requests in rspec.
# See: https://github.com/rspec/rspec-rails/issues/925
def options(*args)
reset! unless integration_session
integration_session.__send__(:process, :options, *args).tap do
copy_session_variables!
end
@melcher
melcher / example.rb
Created Dec 28, 2013 — forked from kritik/gist:1256399
Rails Admin nested form example
View example.rb
class Product < ActiveRecord::Base
has_many :material_product_mappings, :dependent => :destroy, :inverse_of => :product
has_many :materials, :through => :material_product_mappings, :autosave => true
accepts_nested_attributes_for :material_product_mappings # really needed feature
#...
end
@melcher
melcher / gist:6289509
Last active Dec 21, 2015
Not sure what is wrong - keep getting this error. Thought it was winston writing to a system file that was the problem, but I removed that and now I'm not sure what the problem might be. Any thoughts?
View gist:6289509
info: Starting app counter
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: Application crashed with the following output:
error:
error: at AppController._startDrone.connection.on.connection.exec.stream.on.nodejitsu.emit.action (/root/nodejitsu/lib/nodejitsu/resources/app/controller.js:585:26)
error: at Servers.free (/root/nodejitsu/node_modules/conservatory-api/lib/client/servers.js:89:5)
error: at Request.onComplete [as _callback] (/root/nodejitsu/node_modules/conservatory-api/lib/client/client.js:161:7)
error: at Request.init.self.callback (/root/nodejitsu/node_modules/conservatory-api/node_modules/request/main.js:127:22)
@melcher
melcher / sample_ccda
Last active Dec 21, 2015
CCDA XML with \r\n
View sample_ccda
'<?xml version="1.0"?>\r\n<?xml-stylesheet type="text/xsl" href="CDA.xsl"?>\r\n<!--\r\n\tTitle: US_Realm_Header_Template\r\n\r\n\tRevision History:\r\n\t 01/31/2011 bam created\r\n 07/29/2011 RWM modified\r\n 11/26/2011 RWM modified\r\n 08/12/2012 RWM modified\r\n 09/12/2012 BNR(Dragon) modified\r\n\r\n -->\r\n<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r\n xsi:schemaLocation="urn:hl7-org:v3 C:\\XML\\C32_CDA_Schema\\infrastructure\\cda\\C32_CDA.xsd"\r\n xmlns="urn:hl7-org:v3"\r\n xmlns:cda="urn:hl7-org:v3"\r\n xmlns:sdtc="urn:hl7-org:sdtc">\r\n \r\n <!--\r\n********************************************************\r\n CDA Header\r\n********************************************************\r\n\t-->\r\n <!-- CONF 16791 -->\r\n <realmCode\r\n code="US"/>\r\n \r\n <!-- CONF 5361 -->\r\n <typeId\r\n root="2.16.840.1.113883.1.3"\r\n extension="POCD_HD000040"/>\r\n \r\n <!-- US General Header Template -->\r\n <!-- CONF 5252 -->\r\n <template
View gist:6238328
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="CDA.xsl"?>
<!--
Title: US_Realm_Header_Template
Revision History:
01/31/2011 bam created
07/29/2011 RWM modified
11/26/2011 RWM modified
08/12/2012 RWM modified
@melcher
melcher / deploy-heroku.rb
Created Jul 18, 2013
Some code that uses headless heroku and github to enable continuous delivery (e.g. a new server for each pull request and cleanup of servers once they're merged). This is BETA and (although it should work) it may have bugs. Also, it relies on using a forked headless heroku (https://github.com/healthio/heroku-headless) until https://github.com/mo…
View deploy-heroku.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'active_support/all'
require 'heroku-headless'
require 'heroku-api'
require 'github_api'
module ContinuousDelivery