Skip to content

Instantly share code, notes, and snippets.

View palexander's full-sized avatar

Paul R Alexander palexander

View GitHub Profile
@palexander
palexander / header_data.txt
Last active August 29, 2015 14:00
Example format for NCBO multipart/mixed ontology submission with file
Content-Type: multipart/mixed; boundary=OntologiesAPIMultipartPost; type=application/json; start=json
Content-Length: 328853
@palexander
palexander / 0_reuse_code.js
Created June 3, 2014 07:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@palexander
palexander / expand_labels.go
Created September 18, 2014 23:20
Find RXNORM ingredients and brand names then expand the labels across CUI mappings to NCI and SNOMEDCT_US
package main
import "github.com/palexander/goumls"
import "log"
func main() {
// Filters for queries
rxnorm := toEntries("RXNORM")
rxnormTTY := toEntries("IN", "BN")
expandedTTY := toEntries("AB", "PT", "SY")
@palexander
palexander / benchmark_dbs_vs_marshal.rb
Created April 28, 2015 17:41
Benchmark Ruby storage mechanisms
def time_code(name, &block)
t1 = Time.now
yield
puts "#{name}: #{(Time.now - t1).to_f.round(2)}s"
end
def time_code_aggregate(name, &block)
unless @tc_at_exit
at_exit do
@tc_timers.each do |name, time|
jQuery(document).ready(function(){
var url = "/#TB_inline?height=400&width=600&inlineId=not_browsable_content&modal=true"
tb_show("", url);
});
<div id="not_browsable_content" style="display:none;">
<p>Text for display in modal Thickbox.</p>
</div>
# The redirect controller allows for routes-based redirects
# as we move old content to new URL locations.
class RedirectController < ApplicationController
def index
if params[:url] # We were provided with a url to redirect to
params_string = ""
# Trigger to switch the placeholders
first_param = true
# Loop through the given params, ignore ones we know about or are provided by default
jQuery("#autocomplete").autocomplete(data, {
onFindValue: jumpToValue,
onItemSelect: jumpToSelect,
formatItem: formatItem
footer: '<div style="color: grey; font-size: 8pt; font-family: Verdana; padding: .8em .5em .3em;">Results provided by <a style="color: grey;" href="http://bioportal.bioontology.org">NCBO BioPortal</a></div>',
});
Jun 27, 2010 10:15:56 PM org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor processChildren
SEVERE: Exception invoking periodic operation:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:114)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
at java.lang.Thread.run(Thread.java:619)
Jun 27, 2010 10:16:42 PM org.apache.tomcat.util.net.AprEndpoint$Acceptor run
SEVERE: Socket accept failed