Skip to content

Instantly share code, notes, and snippets.

View jimallman's full-sized avatar

Jim Allman jimallman

View GitHub Profile
@jimallman
jimallman / chord-seq3-pachelbel.vcv
Created February 7, 2020 06:40
Test patch (Pachelbel's Canon in D) for VCV Rack and Chord CV
{
"version": "1.1.6",
"modules": [
{
"id": 1,
"plugin": "Core",
"version": "1.1.6",
"model": "AudioInterface",
"params": [],
"leftModuleId": 2,
@jimallman
jimallman / gather-curator-names.py
Created September 21, 2019 17:35
Gather all unique OpenTree curator names from phylesystem
#!/usr/bin/env python3
# Scan all nearby studies for unique '^ot:curatorName' values
import os
import json
studies_found = 0
unique_names = [ ]
try:
# look for "bundles" of studies with IDs ending in (e.g.) "99"
for bundle_dirname in os.listdir('study'):
@jimallman
jimallman / local-devtree-proxy.pac
Last active May 30, 2017 00:00
Test of Proxy Auto-Configuration (PAC) file as a replacement for messing with /etc/hosts
function FindProxyForURL( url, host ) {
var debugging = false;
var debugPAC;
if (debugging) {
debugPAC = "host: "+ host +"\n";
debugPAC += "url: "+ url +"\n";
debugPAC += "dnsDomainIs(host, 'devtree.opentreeoflife.org'): "+ dnsDomainIs(host, "devtree.opentreeoflife.org") +"\n";
debugPAC += "dnsDomainIs( host, '.devtree.opentreeoflife.org' ): "+ dnsDomainIs( host, '.devtree.opentreeoflife.org' ) +"\n";
debugPAC += "shExpMatch(host, 'devtree.opentreeoflife.org'): "+ shExpMatch(host, "devtree.opentreeoflife.org") +"\n";
}
@jimallman
jimallman / config-test.py
Created July 16, 2015 15:35
Quick test of local config file (for web-app configuration, etc)
# A quick validator for web-app config files
import os
from ConfigParser import SafeConfigParser
conf = SafeConfigParser({})
if not os.path.isfile("./config"):
print("Expecting a file 'config' in the current directory")
exit()
conf.read("./config")
try:
@jimallman
jimallman / gist:9f4a4b63f4c8d8a840d3
Created July 28, 2014 17:47
Failing MRCA call (pg_420)
curl 'http://api.opentreeoflife.org/treemachine/v1/getDraftTreeMRCAForNodes' -H 'Origin: http://tree.opentreeoflife.org' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36' -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: http://tree.opentreeoflife.org/curator/study/edit/pg_420/?tab=trees&tree=tree522' -H 'Connection: keep-alive' --data-binary '{"ottIds":[1085741,613883,463177,568571,28336,515158,370815,507121,699624,952596,901831,531218,73933,390841,44860,1041027,799167,683046,463185,872124,44875,622872,29742,682886,1020126,989086,276608,512910,332937,619340,438662,786441,438656,1015202,966327,549518,989084,284297,483804,244695,989088,483803,484896,815707,291638,733986,467838,991312,1097399,834690,412128,989089,1065611,897862,1039512,261312,178684,1065605,98071,427905,119211
@jimallman
jimallman / Quick check of final .jar
Created April 17, 2014 01:37
Output from pushing taxomachine (after pushing waaay back to old version)
$ ls -alF /home/opentree/repo/taxomachine/target/taxomachine-0.0.1-SNAPSHOT.jar
-rw-r--r-- 1 opentree opentree 162163 Apr 17 01:35 /home/opentree/repo/taxomachine/target/taxomachine-0.0.1-SNAPSHOT.jar
$ ls -alF /home/opentree/.m2/repository/org/opentree/taxomachine/0.0.1-SNAPSHOT/taxomachine-0.0.1-SNAPSHOT.jar
-rw-r--r-- 1 opentree opentree 162163 Apr 17 01:35 /home/opentree/.m2/repository/org/opentree/taxomachine/0.0.1-SNAPSHOT/taxomachine-0.0.1-SNAPSHOT.jar
@jimallman
jimallman / gist:10946897
Created April 17, 2014 01:27
Output from push (taxomachine, after forcing to previous version)
WARNING: Missing GitHub client ID! Curation UI will be disabled.
WARNING: Missing GitHub client ID! Tree-view feedback will be disabled.
host=ec2-54-203-194-13.us-west-2.compute.amazonaws.com, admin=admin, pem=/Users/jima/.ssh/opentree/opentree.pem, controller=jima, command=taxomachine
Syncing
JAVA_HOME is /usr/lib/jvm/java-7-openjdk-amd64
Using branch master of repo jade
Already up-to-date.
Repository jade is unchanged since last time
Using branch master of repo ot-base
Already up-to-date.
@jimallman
jimallman / gist:10946715
Created April 17, 2014 01:22
Output from push to ot9 (taxomachine only, up to date)
WARNING: Missing GitHub client ID! Curation UI will be disabled.
WARNING: Missing GitHub client ID! Tree-view feedback will be disabled.
host=ec2-54-203-194-13.us-west-2.compute.amazonaws.com, admin=admin, pem=/Users/jima/.ssh/opentree/opentree.pem, controller=jima, command=taxomachine
Syncing
JAVA_HOME is /usr/lib/jvm/java-7-openjdk-amd64
Using branch master of repo jade
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
Updating 601fb15..1c55c91
Fast-forward
CONTRIBUTORS | 23 ++
@jimallman
jimallman / gist:9275020
Created February 28, 2014 17:06
Mismatched branch + study
~/repo/phylesystem_test$ git status
# On branch jimallman_study_10
# Changes to be committed:
#
# modified: study/9/9.json
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: study/10/10.json
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
d3.phylogram.build(selector, nodes, options)
Creates a phylogram.
Arguments:
selector: selector of an element that will contain the SVG