Skip to content

Instantly share code, notes, and snippets.

View mustmodify's full-sized avatar

Johnathon "jw" Wright mustmodify

View GitHub Profile
i = Message::Identifier.new( hl7_file )
def init_patient
self.patient = find_patient(i.patient_criteria)
some error if( patient.blank? )
end
def init_visit
self.visit = find_visit( i.visit_criteria( patient ))
some_error if ( self.visit.blank? )
brand new slice as root:
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libxml2-dev libxslt-dev libreadline6-dev libyaml-dev libmysqlclient-dev
cd /tmp
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar -xvzf ruby-2.1.2.tar.gz
cd ruby-2.1.2-p<tab>
./configure --prefix=/usr/local
@mustmodify
mustmodify / app.js
Last active December 20, 2015 09:09
A gist that you can use in plnkr as a baseline angularjs app... for demonstrating your problems / confusion. Based on https://gist.github.com/ProLoser/3172544 ... edited because of issues with raw.github.com mime type.
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
@mustmodify
mustmodify / stack_trace_from_an_app.txt
Last active December 21, 2015 14:48
Details of a Rubinius-specific error when using the pdf-reader gem
TypeError: String#append primitive only accepts Strings
from kernel/bootstrap/string.rb:25:in `append'
from kernel/common/string19.rb:623:in `<<'
from /home/jw/.rvm/gems/rbx-head/gems/pdf-reader-1.3.3/lib/pdf/reader/buffer.rb:307:in `prepare_regular_token'
( https://github.com/yob/pdf-reader/blob/v1.3.3/lib/pdf/reader/buffer.rb#L307 )
from /home/jw/.rvm/gems/rbx-head/gems/pdf-reader-1.3.3/lib/pdf/reader/buffer.rb:174:in `prepare_tokens'
( https://github.com/yob/pdf-reader/blob/v1.3.3/lib/pdf/reader/buffer.rb#L174 )
@mustmodify
mustmodify / puma-as-service appears to start but does not
Last active December 22, 2015 14:29
My current puma configuration... not working.
Trying to follow instructions at
https://github.com/puma/puma/tree/master/tools/jungle/init.d#installation
but it doesn't seem to be working. My sense is that public.production.config
is correct since I can start puma with bundle exec puma ( illiustrated below )
but it own't start with /etc/init.d/puma... so I suspect /etc/puma.conf
jw@paisley:~$ sudo /etc/init.d/puma start
[sudo] password for jw:
* => Running the jungle...
@mustmodify
mustmodify / api_notices.js
Created September 23, 2013 21:04
APINotices is an AngularJS module that displays a "working" and "error" div during AJAX requests.
angular.module('ApiNotice', []).
config(function ($httpProvider)
{
$httpProvider.responseInterceptors.push('myHttpInterceptor');
var spinnerFunction = function (data, headersGetter)
{
// todo start the spinner here
$('#api-error').hide();
$('#api-access').show();
return data;
@mustmodify
mustmodify / gist:8025015
Created December 18, 2013 16:12
RVM failed to clean itself up. Is this OK?
jw@logopolis:/projects/saw/v3$ rvm cleanup all
Cleaning up rvm archives
Cleaning up rvm repos
Cleaning up rvm src
Cleaning up rvm log
Cleaning up rvm tmp
Cleaning up rvm gemsets
Cleaning up rvm links
chmod: cannot operate on dangling symlink `/home/jw/.rvm/bin/gem-rbx-head@medycation'
- failed - /home/jw/.rvm/bin/gem-rbx-head@medycation
@mustmodify
mustmodify / abilities.rb
Created February 17, 2014 15:52
handling admin and user-lever permissions in fairly large apps
module User::Abilities
# this is included in User
#
# class User < AR:B
# include Abilities
# end
#
def can_create?( object )
admin? ||
case object
format.js do
@order = params[:orders]}
end
format :js { render :action => 'create', :locals => {:order => params[:orders]}}
{
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2014 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2014 MapQuest, Inc."
},
"messages": []
},