Skip to content

Instantly share code, notes, and snippets.

View birm's full-sized avatar

Birm birm

View GitHub Profile
@birm
birm / restpost.html
Last active May 22, 2017 17:41
JNLP Form Independent Page
<html>
<style>
.spinner {
width: 20px;
height: 20px;
position: relative;
margin: 15px;
}
.double-bounce1,
.double-bounce2 {
@birm
birm / A quick sample for using links to store state
Last active June 22, 2017 19:37
Url Variable Encoding and Decoding
@birm
birm / camic_state_link.html
Created August 9, 2017 21:49
A very simple site to generate state links for camicroscope
@birm
birm / parallel_async.js
Last active August 25, 2017 20:50
Parallel Async
// get the url
var apiurl = "";
// range to draw of each variable
var ranges = {"A":[0,15],"B":[10,20]};
// get filtered data from table api
function get_async(page){
var xhr = new XMLHttpRequest();
// while there's more to load
xhr.open("GET", apiurl, true);
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.3.0/openseadragon.min.js"></script>
</head>
<body>
<div id="head"></div>
<div id="about"></div>
<div id="windows">
<div id="first" style="width: 800px; height: 600px;"></div>
</div>
@birm
birm / data.json
Last active September 14, 2017 19:27
{"data":[[457,"0",1,"Millet, Mr. Francis Davis","male",65,0,0,"13509",26.55,"E38","S",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],[7,"0",1,"McCarthy, Mr. Timothy J","male",54,0,0,"17463",51.8625,"E46","S",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],[22,"1",2,"Beesley, Mr. Lawrence","male",34,0,0,"248698",13,"D56","S",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],[873,"0",1,"Carlsson, Mr. Frans Olof","male",33,0,0,"695",5,"B51 B53 B
@birm
birm / box_api.js
Last active January 19, 2018 16:12
var rp = require('request-promise');
var fs = require('fs');
// use https://developer.box.com/v2.0/docs/the-box-file-picker
// options to get file
function download_file(url) =
return {
method: 'GET',
uri: url,
@birm
birm / cloner.js
Last active February 14, 2018 16:15
Coordinated Drawing on Annotools.
// call cloner with base and a list of items to clone (same type preferably) of the same type
function cloner(base, clones){
var handler = {
get(target, name, reciever){
if (typeof target[name] == "function"){
// call the function with args to all contexts
return function (...args){
clones.forEach((x) => x[name].apply(this, args));
// return whatever base returns
return target[name].apply(this, args)
var http = require('http');
var fs = require('fs');
var fetch = require('node-fetch');
const exec = require('child_process').exec;
var sourceUrl = "http://172.20.11.223:9099/services/Camic_TCIA/Image/query/find"
function freeze(time) {
const stop = new Date().getTime() + time;
while(new Date().getTime() < stop);
FROM ubuntu
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends python-pip cmake wget sudo \
libopenblas-dev liblapack-dev binutils-dev libboost-all-dev pkg-config \
make txt2man git doxygen libarmadillo-dev build-essential
# Get mlpack version.
ARG mlpack_archive