Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View melcher's full-sized avatar

Graham Melcher melcher

View GitHub Profile
@melcher
melcher / slow_report.rb
Last active November 20, 2018 17:14
Payment
We couldn’t find that file to show.
@melcher
melcher / interview-notes.md
Created May 29, 2017 20:33
December Labs - Agustin Interview Notes

Api Docs

Show Invoice

URL

/practices/:practice_uid/invoices/:invoice_uid

Method

GET

URL params

@melcher
melcher / example.rb
Created December 28, 2013 20:33 — forked from kritik/gist:1256399
Rails Admin nested form example
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 December 21, 2015 10:08
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?
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 December 21, 2015 02:58
CCDA XML with \r\n
'<?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
<?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 July 18, 2013 04:43
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…
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'active_support/all'
require 'heroku-headless'
require 'heroku-api'
require 'github_api'
module ContinuousDelivery
@melcher
melcher / request_helper.rb
Created February 6, 2014 23:53
Adds support for OPTIONS verb testing in rspec-rails Request (integration) tests
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