Skip to content

Instantly share code, notes, and snippets.

View patrickread's full-sized avatar

Patrick Read patrickread

View GitHub Profile
@patrickread
patrickread / enrollment.txt
Last active May 4, 2016 17:39
834 Health Insurance Enrollment Example
INS*Y*18*030**A~
REF*0F*435343456~
REF*1L*1234567890~
DTP*336*D8*20110401~
NM1*IL*1*Williams*Dylan****34*435343456~
N3*629 N High St*Floor 6~
N4*Columbus*OH*43215*USA~
DMG*D8*19750303*M~
HD*030**DEN**EMP~
DTP*348*D8*20160401~
@patrickread
patrickread / enrollment.json
Created May 4, 2016 17:30
JSON Health Insurance Enrollment Example
{
"subgroup_number": "1234567890",
"effective_at": "2016-04-01",
"coverage_type": "employee",
"members": [
{
"first_name": "Dylan",
"last_name": "Williams",
"role": "primary",
"member_id": "435343456",
@patrickread
patrickread / mac_address.rb
Created January 22, 2015 21:33
Random MAC Address
def random_mac_address
hex_list = '0123456789ABCDEF'.split(//)
mac = ""
for i in 0..16
if i % 3 == 2
mac += ':'
else
mac += hex_list.sample
end
end
class ApplicationController < ActionController::Base
# ...
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, with: lambda { |exception| render_error 500, exception }
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception }
end
private
def render_error(status, exception)