Skip to content

Instantly share code, notes, and snippets.

@FrankRuns
FrankRuns / index.html
Last active December 21, 2015 16:02
Deconsol Map
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
Country Continent Region Debt2GDP TotalDebt GDP PercentDebt Above99 10yGDPGrowth
United States North America North America 0.744 12908400000000 17350000000000 0.239 FALSE 1.58
Japan Asia Eastern Asia 2.319 11054673000000 4767000000000 0.205 TRUE 0.61
India Asia South-Central Asia 0.517 3831487000000 7411000000000 0.071 FALSE 7.69
Italy Europe Southern Europe 1.320 2818200000000 2135000000000 0.052 TRUE -0.48
Germany Europe Western Europe 0.743 2784764000000 3748000000000 0.052 FALSE 1.32
China Asia Eastern Asia 0.149 2695410000000 18090000000000 0.050 FALSE 9.99
France Europe Western Europe 0.955 2474405000000 2591000000000 0.046 FALSE 0.87
United Kingdom Europe Northern Europe 0.881 2263289000000 2569000000000 0.042 FALSE 1.34
Brazil South America Central Eastern South America 0.589 1929564000000 3276000000000 0.036 FALSE 3.41
@FrankRuns
FrankRuns / d3.legend.js
Last active February 7, 2016 20:32
Uber Surge Pricing
// js to create legend in multiline chart on uber viz page
// thank you Ziggy Jonson: http://bl.ocks.org/ZJONSSON
// http://bl.ocks.org/ZJONSSON/3918369
(function() {
d3.legend = function(g) {
g.each(function() {
var g= d3.select(this),
items = {},
svg = d3.select(g.property("nearestViewportElement")),
@FrankRuns
FrankRuns / centos_python_env_setup
Created May 18, 2016 10:40 — forked from floer32/centos_python_env_setup
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
# Weather Underground API history call format example
# http://api.wunderground.com/api/<YOUR_API_KEY>/history_20060405/q/CA/San_Francisco.json
start_string = "http://api.wunderground.com/api/<YOUR_API_KEY>/history_"
end_string = "/q/MN/Minneapolis.json"
the_dates = ['2015-05-24', '2015-10-29', '2015-11-06', '2015-09-27',
'2015-04-01', '2015-06-16', '2015-08-28', '2015-08-30',
'2015-05-15', '2015-03-06', '2015-01-24', '2015-05-07',
'2015-01-02', '2015-09-01', '2015-10-17', '2015-08-10',
@FrankRuns
FrankRuns / get_running_hotspots.py
Last active December 25, 2019 01:16
this gist helps parse an osm file to identify good running nodes in an area of interest
# python3
# this gist helps parse an osm file to identify good
# running nodes in an area of interest
import xml.etree.cElementTree as ET # to parse OSM file
import folium # to create map
from folium.plugins import MarkerCluster # to create map
import os # to view map
import webbrowser # to view map
@FrankRuns
FrankRuns / pa-sim.r
Created December 29, 2020 12:21
Simple Sim to Understand Preferential Attachment
# load packages
library(tidyverse)
library(ggplot2)
library(gganimate)
# define initialization parameters
the_step <- rep(0, 5)
the_options <- c(1,2,3,4,5)
print(the_options)
library(tidyverse)
library(ggplot2)
# create holder data frame
data <- data.frame(magic_number=numeric(), equity_fraction=numeric(),
mgmt_span=numeric(), ps_fit=numeric(),
salary_growth=numeric())
# create ranges for variables
s_set <- 1:20
@FrankRuns
FrankRuns / uno-sim.ipynb
Last active January 16, 2024 10:18
Python sim for the card Uno
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FrankRuns
FrankRuns / scen-planning-mc-starter.R
Created May 12, 2021 12:14
Script to support scenario planning article
# purpose: support article on scenario planning with monte carlo
# caution: this is a learning script (for me, and you)
# read packages
library(dplyr)
library(ggplot2)
library(tidyr)
library(EnvStats)
library(MASS)