Skip to content

Instantly share code, notes, and snippets.

ADT Dropbox

Cureatr can accept encrypted HL7 ADT batch files uploaded via sftp to our dropbox server. Cureatr has two dropbox servers, playdrop.play.aws.cureatr.com is our internal staging (play) environment and dropbox.live.aws.cureatr.com is our production (live) environment.

Cureatr will need an ssh public key file for each of these environments to provision sftp accounts for an institution, and will provide the sftp login username to the institution.

Each HL7 file should contain one or more ADT message separated by newline \n and with each segment within the message separated by carriage return \r. The file should be encrypted and BASE64 encoded using OpenSSL: openssl enc -aes-256-cbc -a -in <hl7-file> -out <hl7-file-enc>

@rectalogic
rectalogic / gist:6322397
Created August 23, 2013 18:21
daemonize2
Running:
uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13703 1 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13704 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13705 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13706 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13707 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
# master
@rectalogic
rectalogic / index.html
Last active December 11, 2015 22:18
Play a video on iPhone, toggle between playing and pausing when device is shaken.
<html>
<head>
<script type="text/javascript">
if (typeof window.DeviceMotionEvent != 'undefined') {
// Shake sensitivity (a lower number is more)
var sensitivity = 20;
// Position variables
var x1 = 0, y1 = 0, z1 = 0, x2 = 0, y2 = 0, z2 = 0;
<html>
<head>
<script type="text/javascript">
function init() {
var video = document.getElementById("video");
video.addEventListener('pause', stopLogging, false);
video.addEventListener('playing', startLogging, false);
console.log("READY");
}
function stopLogging() {
execute "unattended-upgrades" do
command "unattended-upgrades"
only_if 'grep security /var/lib/update-notifier/updates-available'
end
{
"source": "http://somehost.com/movie.mov",
"formats": {
"poster": "container1/poster.jpg",
"thumbnail": "container2/thumb.jpg",
"standard_definition": "container3/video.mp4"
}
}
@rectalogic
rectalogic / gist:3153015
Created July 20, 2012 20:21
multiple filters with MSAA
Index: src/test/jme3test/post/TestPosterization.java
===================================================================
--- src/test/jme3test/post/TestPosterization.java (revision 9561)
+++ src/test/jme3test/post/TestPosterization.java (working copy)
@@ -43,6 +43,7 @@
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.PosterizationFilter;
+import com.jme3.post.filters.CrossHatchFilter;
import com.jme3.renderer.queue.RenderQueue.ShadowMode;
@rectalogic
rectalogic / gist:3151867
Created July 20, 2012 16:54
multisample offscreen rendering in TestRenderToMemory
Index: src/test/jme3test/post/TestRenderToMemory.java
===================================================================
--- src/test/jme3test/post/TestRenderToMemory.java (revision 9561)
+++ src/test/jme3test/post/TestRenderToMemory.java (working copy)
@@ -75,6 +75,7 @@
private float angle = 0;
private FrameBuffer offBuffer;
+ private FrameBuffer resolveBuffer;
private ViewPort offView;
@rectalogic
rectalogic / gist:3061649
Created July 6, 2012 17:56
Extend rspec with a method similar to should_receive but that invokes the original method
module RSpec
module Mocks
module Methods
def should_receive_invoke(message, opts={})
original_method = self.method(message.to_sym)
should_receive(message, opts) do |*args|
original_method.call(*args)
end
end
end
@rectalogic
rectalogic / gist:3061630
Created July 6, 2012 17:55
Extend rspec with a method similar to should_receive but that invokes the original method
module RSpec
module Mocks
module Methods
def should_receive_invoke(message, opts={}, &block)
original_method = self.method(message.to_sym)
should_receive(message, opts) do |*args|
original_method.call(*args)
end
end
end