Skip to content

Instantly share code, notes, and snippets.

🤷‍♂
I should be coding

Timothy James Dobbins tmthyjames

🤷‍♂
I should be coding
Block or report user

Report or block tmthyjames

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tmthyjames
tmthyjames / geoflow.js
Created Dec 3, 2016
Concentric Circles for same lat,lng
View geoflow.js
var newLatLng = function(olat, olng, r, degrees){
var lat1 = olat * Math.PI/180.0;
var lon1 = olng * Math.PI/180.0;
var d = (r/6371)/1000; //radius of the earth in km, accounts for curvature
var lon, loc;
var tc = degrees * Math.PI/180.0; // convert to radians to use trig functions
var lat = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc));
lat = 180.0 * lat / Math.PI;
if (Math.cos(lat1) == 0){
lon = olng;
View SQLCell_Readme.html
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>SQLCell Readme</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style type="text/css">
/*!
@tmthyjames
tmthyjames / stealth_scraping.ipynb
Created Aug 27, 2016
Scraping EPA data using randomized time delays and a PhantomJS headless browser
View stealth_scraping.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmthyjames
tmthyjames / SQLCell.ipynb
Created Aug 14, 2016
SQL Magic Function for Jupyter Notebook
View SQLCell.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmthyjames
tmthyjames / point_spreads.ipynb
Created Jul 21, 2016
Point Spread Predictions for NBA/NCAA
View point_spreads.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmthyjames
tmthyjames / KNNNBA.ipynb
Last active Jan 23, 2017
NBA K Nearest Neighbors
View KNNNBA.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmthyjames
tmthyjames / README.md
Last active Jul 20, 2016
Treemap of Patient Leakage
View README.md

This is a treemap representing patient leakage, inspired by Mike's block

View in full screen to see legend.

@tmthyjames
tmthyjames / geojson.js
Last active Jul 20, 2016
Leaflet rendering and calculation of perfect geographical circles in python jupyter kernel
View geojson.js
var radiusFromLatLon = function(latIn, lonIn, radius){
var locs = [];
var lat1 = parseFloat(latIn) * Math.PI/180.0;
var lon1 = parseFloat(lonIn) * Math.PI/180.0;
var d = radius/3956.0;
var range360 = Array.apply(null, Array(360)).map(function (_, i) {return i;});
for (var i in range360){
var lon, loc;
var tc = (range360[i] / 90.0) * Math.PI/2.0;
var lat = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc));
@tmthyjames
tmthyjames / README.md
Last active Jul 20, 2016
Spatial Sankey for Shared Patients Between Doctors and Hospitals
View README.md

This example is inspired by yellowcap's block with many enhancements, including UI changes and rendering optimizations since I was dealing with larger data sets.

This spatial sankey graph shows the geographical flow of patients from doctors to general acute care hospitals. The selected hospital (green node) is the target hospital, which receives at least one visit from every physician (blue or red nodes). The physician nodes are colored red or blue based on their amount of patient leakage (inverse of marketshare: 1-marketshare). Leakage is defined as all visits to hospitals (usually general acute care hospitals) where the receiving hospital is not the physician's primary hospital. Blue nodes have the smallest leakage amount so they are known as loyalists because they send at least 75% of all general acute care hospital visits to the selected

@tmthyjames
tmthyjames / nbaknn.ipynb
Last active Jul 6, 2016
nba k-nearest neighbor
View nbaknn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.