Skip to content

Instantly share code, notes, and snippets.

View alexbfree's full-sized avatar

Dr. Alex Bowyer alexbfree

View GitHub Profile
@alexbfree
alexbfree / index.html
Created November 3, 2022 20:11
yLEJegW
<!DOCTYPE html>
<html>
<body>
<h1>DelftStack learning</h1>
<h2>JavaScript get document referrer example</h2>
<!doctype html>
<html>
<head>
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script>
<script src="../dist/d3-timelines.js"></script>
<style type="text/css">
.axis path,
.axis line {
@alexbfree
alexbfree / index.js
Created April 5, 2017 10:29
script to decode a polyline (monkseaton to south shields) and check for a station (palmersville) on that line
let polyline = require('@mapbox/polyline');
let points = polyline.decode('si}nI~x{G[vAoAu@_ChKs@pDg@jDW~CMtBIrD?tBJzDp@|GVbBv@bEzGbZrFzU~AfHxApGlAxGhAxH|@fIj@vGXtFX|HVnMjBteAZxPE@TfKZ|HdAxMdBdR\\lCt@hDjA~CfBrCfAjBv@~Az@~B`AvCv@~B`GlQ|EtN|CvJzHhUrErNfJpX~AzEjBpEfBtEL^DGtD`LpBbGzAxDx@`Br@fAtEdHp@nA~@`Cz@`Dp@xDRxBPzBj@bEbAzEpBlH`CjK~BzKxEzTbDfOdCbMxCvN~@fEh@|ChAnFxAtFfD~Kr@~Bz@jDdBrHrAxI`AnJd@~HPdFL`KChGSvImAlUwAzWo@bLIfC?fA@fANlE^hDn@lDx@vCbA`CtAzBrAzAn@h@dAj@TJhA\\|CfA`J`DdEpArHfCrFlB`Bl@@IrEvAtCl@xCRnBAlBUpAQhAYjBo@nB_A|ByAtBgBtDeDpDsClCaBtD_BbA_@vBk@~KyBpGsAtFmAx@Gd@Ah@B|B`@|A\\~@p@|@fAzAbCpAdCfBtDbE`LfDhI~@pB|A`Cn@r@^Z|@\\hA@dBOxEw@hGu@f@AjANhBp@vAt@rHpEhI~Er@h@t@`@t@XbANfCZ~@Cn@UbAy@xAuBxBiDnLuQZu@\\eBnHul@FDxI}r@pAmLbAiKj@iDxAoFjFaPp@mCh@wCjB_LpBoMbE_XZwBjAeGz@cEn@yDdAgHQKFa@bCoPt@mGf@oFn@_KZ_I\\gY?oCMoD_@yHOqB{@gUwA}_@c@}Pc@gM]uWOcHIcB[}Bq@cDi@wA}@aB}@eAo@i@_Ac@y@SgAKmBGiBUaEy@{UkE_KiBeJiBsCm@_D_@cGkA}Cy@wB{@oCsAyBmAwCwBgC}BwD_EyBkC_CiDiAgBgAiBaD}FuAuCaBsDm@wAsBuFmAyD_B{Fk@cCgAkFwD_S{DySy@sG]kESeEI{E?mEH
@alexbfree
alexbfree / remove-subjects.js
Created June 29, 2016 09:23
connect to Panoptes JS API and remove subjects
#!/usr/bin/env node
require('es6-promise').polyfill();
// staging
//var PROJECTID = "1611";
//var WORKFLOWID = "2315";
//var SUBJECTSETID = "3700";
//var SUBJECT_IDS_TO_DELETE = ["45046"];
// production
@alexbfree
alexbfree / panoptes-javascript-client-example.js
Last active May 12, 2016 17:05
An example of how to connect to the Panoptes Javascript client (see https://github.com/zooniverse/panoptes-javascript-client )
#!/usr/bin/env node
require('es6-promise').polyfill();
// staging
var PROJECTID = "1611";
var WORKFLOWID = "2315";
var SUBJECTSETID = "3700";
var glob = require('glob');
var argv = require('yargs').argv;
T3Please_draw_a_box_around_each_individual_animal_in_rectangle_summary.csv
subject_id : Panoptes subject ID
median(left) : Median number of distinct cluster of markings of left-facing animals
median(right) : Median number of distinct clusters of markings of right-facing animals
median(away) : Median number of distinct clusters of markings of away-facing animals
median(towards) : Median number of distinct clusters of markings of toward-facing animals
mean_probability : The mean average percentage of people who had markings in each cluster
median_probability : The median average percentage of people who had markings in each cluster
mean_tool : the mean average percentage of people who agreed with the most popular direction for that cluster
We can't make this file beautiful and searchable because it's too large.
"url","Subject ID","Frame","Season","Site","Roll","Decision Type","Crowd Determination","Total Species Present","Total Animals Present","View Discussions"
"http://www.snapshotserengeti.org/subjects/standard/5331dea71bccd304b6073cf5_1.JPG","ASG00128gp","2","7","H01","R2","10 opinions agree upon the species present","Giraffes","1","1","https://talk.snapshotserengeti.org/#/subjects/ASG00128gp"
"http://www.snapshotserengeti.org/subjects/standard/51a35ce6e18f49172b11ff04_2.jpg","ASG000r0hc","3","5","L04","R1","10 opinions agree upon the species present","Elephants","1","1","https://talk.snapshotserengeti.org/#/subjects/ASG000r0hc"
"http://www.snapshotserengeti.org/subjects/standard/51a3348ae18f49172b0d3036_0.jpg","ASG000pvu9","1","5","H08","R1","10 opinions agree upon the species present","Zebras","1","5","https://talk.snapshotserengeti.org/#/subjects/ASG000pvu9"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/54cfcbae87ee0404d50217b9_0.JPG","ASG001fb6f","1","8","E06","R2","1
@alexbfree
alexbfree / launch_dataset_apr16.csv
Created April 25, 2016 13:57
Launch dataset for Snapshot Serengeti: Computer Vision: elephants, zebras, giraffes, gazelles (both), guineafowls, warthog, hartebeest, buffalo, wildebeest, ostrich
We can't make this file beautiful and searchable because it's too large.
"url","Subject ID","Frame","Season","Site","Roll","Decision Type","Crowd Determination","Total Species Present","Total Animals Present","View Discussions"
"http://www.snapshotserengeti.org/subjects/standard/5331dea71bccd304b6073cf5_1.JPG","ASG00128gp","2","7","H01","R2","10 opinions agree upon the species present","Giraffes","1","1","https://talk.snapshotserengeti.org/#/subjects/ASG00128gp"
"http://www.snapshotserengeti.org/subjects/standard/51a35ce6e18f49172b11ff04_2.jpg","ASG000r0hc","3","5","L04","R1","10 opinions agree upon the species present","Elephants","1","1","https://talk.snapshotserengeti.org/#/subjects/ASG000r0hc"
"http://www.snapshotserengeti.org/subjects/standard/51a3348ae18f49172b0d3036_0.jpg","ASG000pvu9","1","5","H08","R1","10 opinions agree upon the species present","Zebras","1","5","https://talk.snapshotserengeti.org/#/subjects/ASG000pvu9"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/54cfcbae87ee0404d50217b9_0.JPG","ASG001fb6f","1","8","E06","R2","1
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
"url","Subject ID","Frame","Season","Site","Roll","Decision Type","Crowd Determination","Total Species Present","Total Animals Present"
"http://www.snapshotserengeti.org/subjects/standard/50dc84e6a2fc8e378903a8e7_2.jpg","ASG000by4n","3","4","E02","R1","10 opinions agree this is blank","No animals present","0","0"
"http://www.snapshotserengeti.org/subjects/standard/51a3ba00e18f49172b1d0cec_1.jpg","ASG000ti58","2","5","T11","R4","First 5 opinions were blank","No animals present","0","0"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/5582de3bc4af4e00420005d5_0.JPG","ASG001gjz3","1","0","G04","R2","First 5 opinions were blank","No animals present","0","0"
"http://www.snapshotserengeti.org/subjects/standard/51e8f419e0053a09c3097ee6_0.jpg","ASG00105w9","1","6","L03","R2","First 5 opinions were blank","No animals present","0","0"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/54cfdc8587ee0404d50a6717_0.JPG","ASG0019yo7","1","8","R09","R2
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
"url","Subject ID","Frame","Season","Site","Roll","Decision Type","Crowd Determination","Number of Species Present","Number of Animals Present","View Discussions"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/54cfd61d87ee0404d507427d_0.JPG","ASG001e9jy",1,8,"L10","R1","First 5 opinions were blank","No animals present",0,0,"https://talk.snapshotserengeti.org/#/subjects/ASG001e9jy"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/54cfd70587ee0404d507b6e1_0.JPG","ASG001ej9i",1,8,"M04","R2","First 5 opinions were blank","No animals present",0,0,"https://talk.snapshotserengeti.org/#/subjects/ASG001ej9i"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/standard/54cfd60587ee0404d5073651_0.JPG","ASG001e8mp",1,8,"L08","R3","First 5 opinions were blank","No animals present",0,0,"https://talk.snapshotserengeti.org/#/subjects/ASG001e8mp"
"http://zooniverse-static.s3.amazonaws.com/www.snapshotserengeti.org/subjects/