Skip to content

Instantly share code, notes, and snippets.

View arm5077's full-sized avatar
😊

Andrew McGill arm5077

😊
View GitHub Profile

This is a randomly generated dataset that simluates a crew roster for a First Order frigate, as seen in Star Wars VII: The Force Awakens.

name: The crew member's name

division: The crew member's assignement (security, droid maintainence, etc.)

salary: The individual's salary, in Galactic Credits

@arm5077
arm5077 / county-centroids.json
Created November 5, 2020 10:13
A CSV of centroids for every county in the US plus PR. Source: https://www.weather.gov/gis/Counties
STATE,COUNTYNAME,FIPS,LON,LAT
ME,Washington,"23029",-67.63610000000,45.03630000000
GA,McIntosh,"13191",-81.26460000000,31.53290000000
GA,Liberty,"13179",-81.21030000000,31.70930000000
AS,Swains Island,"60040",-171.04590000000,-11.08430000000
AS,Manu'a,"60020",-169.50600000000,-14.22190000000
AS,Western,"60050",-170.76910000000,-14.32410000000
AS,Eastern,"60010",-170.65960000000,-14.27630000000
PR,Anasco,"72011",-67.12210000000,18.28700000000
PR,Arroyo,"72015",-66.05630000000,17.99820000000
@arm5077
arm5077 / masthead-reporting-residency.html
Created September 3, 2019 16:51
Archived Masthead Reporting Residency page
<figure class="u-block-center"><img alt="Masthead Reporting Residency Header Image" height="220" src="https://cdn.theatlantic.com/assets/media/img/posts/2019/01/Masthead_Reporting_Residency_header/508d2bd0d.png" width="331" /></figure>
<h2 style="text-align: center;"><strong>Pitch The Atlantic on a Three-Month Reporting Project</strong></h2>
<table align="center" style="width:100%">
<tbody>
<tr>
<td>
<p></p>
<div>
<figure>
<a href="https://www.theatlantic.com/our-towns/"><img alt="" src="https://cdn.theatlantic.com/assets/media/files/notes-footer.png" style="max-width: 100%"></a>
</figure>
<style type="text/css">
figure {
box-sizing: border-box;
border: 1px solid #ccc;
border-bottom: 0px;
}
@arm5077
arm5077 / movies.csv
Created October 17, 2018 12:10
Top 20 movies of all time, by adjusted box office return
Title Studio Adjusted Gross Unadjusted Gross Year
101 Dalmatians Dis. $913,243,700 adjusted $144,880,014 1961
Avatar Fox $889,409,500 adjusted $760,507,625 2009
Ben-Hur MGM $895,720,000 adjusted $74,000,000 1959
Doctor Zhivago MGM $1,134,598,100 adjusted $111,721,910 1965
E.T.: The Extra-Terrestrial Uni. $1,296,548,600 adjusted $435,110,554 1982
Gone with the Wind MGM $1,846,687,900 adjusted $198,676,459 1939
Jaws Uni. $1,170,640,400 adjusted $260,000,000 1975
Jurassic Park Uni. $837,423,500 adjusted $402,453,882 1993
Return of the Jedi Fox $859,703,000 adjusted $309,306,177 1983
@arm5077
arm5077 / generate_insights.r
Last active May 17, 2017 02:49
Pulls insights for The Atlantics "Five Percent" project from Medical Expenditure Panel Survey data
library(foreign)
library(survey)
# Make folder to contain all the output CSVs
dir.create('output', showWarnings = FALSE)
# Download file and unzip into data frame
download.file("https://meps.ahrq.gov/mepsweb/data_files/pufs/h171ssp.zip",temp <- tempfile())
data = read.xport(unzip(temp))
@arm5077
arm5077 / code.gs
Last active May 1, 2017 20:58
Google Apps Script to update PM to-do spreadsheet when task is marked "Done."
function onEdit(e) {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = e.source.getActiveSheet();
var cell = e.source.getActiveRange();
if( sheet.getName() == 'Tasks' && cell.getColumn() == 4 && cell.getValue() == 'Done'){
var row = cell.getRow();
var targetSheet = spreadsheet.getSheetByName("Tasks - done");
var targetRow = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
@arm5077
arm5077 / analyze.r
Last active April 24, 2017 17:48
Pulls the top five percent of U.S. medical spenders and calculates proportions of race.
library(Hmisc)
library(survey)
# Import data from SAS transport file
data <- sasxport.get('data/h171.ssp')
# Build survey object using person weights
full_population_survey <- svydesign(ids=~1, data=data, weights=~perwt14f)
# Find cutoff for top 5 percent of spenders
@arm5077
arm5077 / index.js
Created November 22, 2016 13:50
A script for the Raspberry Pi that turns on a Powerswitch when the user says "Lumos!"
const record = require('node-record-lpcm16');
const {Detector, Models} = require('./node_modules/snowboy/');
const Gpio = require('onoff').Gpio;
// Set up control of the pin that toggles the Powerswitch
power = new Gpio(14, 'out');
var on = false;
// Turn the power off by default
power.writeSync(0);
@arm5077
arm5077 / app.js
Created August 31, 2016 18:43
Template for resizable D3 v4 map
d3.json("topojson/states.topojson", function(states){
// Make SVG container
var map = d3.select("#map");
var svg = map.append("svg");
var country = svg.append("g");
// Grab width of containing element
var width = d3.select("#map").node().offsetWidth;
// Size container to correct dimensions