Skip to content

Instantly share code, notes, and snippets.

@milesgrimshaw
milesgrimshaw / tech_reading.md
Last active August 19, 2021 19:07
Startup Reading
@milesgrimshaw
milesgrimshaw / gist:8941929
Created February 11, 2014 19:13
Analysis of personal Evernote notes archive
# Load packages
library(ggplot2)
library(lubridate)
library(stringr)
library(scales)
# Set the working directory
getwd()
setwd("~/Dropbox/Personal/Projects/Evernote_Analysis/files/")
@milesgrimshaw
milesgrimshaw / inbox_count
Created September 25, 2014 15:33
Google Apps Script to save the count of emails in your inbox
function processInbox() {
// get all threads in inbox
var threads = GmailApp.getInboxThreads();
data_id = '1t70IDdWcaJzCIIaNWm2nHSPKzetHfTxhkKc9jKkAlpA'
var dataSs = SpreadsheetApp.openById(data_id);
var sheet = dataSs.getSheets()[0];
var current_date = new Date();
sheet.appendRow([current_date, current_date.toISOString(),threads.length]);
};
library(stringr)
library(lubridate)
library(ggplot2)
library(scales)
getwd()
setwd("~/Desktop/Personal_Projects/Immersion/")
i <- read.csv("./immersion.csv", header=TRUE, as.is=TRUE)
## Only get those emails that I sent
## Code for subsetting and formatting open paths data for Mapbox
## Miles Grimshaw
## December 26th 2013
## Set working directory and load required packages
getwd()
setwd("~/Dropbox/Personal/Mapbox/OpenPaths/")
library(stringr)
library(lubridate)
# library(ggplot2)
require 'csv'
require 'json'
require 'pp'
i = 0
features = []
start_line = []
end_line = []
## Loop through each row of the data
@milesgrimshaw
milesgrimshaw / gist:5996636
Last active December 19, 2015 18:09
Merge JSON files of personal gmail header data and save as single CSV.
## MILES GRIMSHAW
require 'mechanize'
require 'csv'
require 'open-uri'
require "pp"
require "json"
CSV.open("immersion.csv", "wb") do |csv|
csv << ["Text","Date"]
@milesgrimshaw
milesgrimshaw / gist:5523271
Created May 6, 2013 03:52
R code for Personal Data Analytics
### Miles Grimshaw Code For Blog Post on Personal Data
### May 5th 2013
getwd()
setwd("~/Desktop/x_Final_Project")
library(stringr)
library(lubridate)
library(ggplot2)
@milesgrimshaw
milesgrimshaw / gist:5392161
Created April 15, 2013 23:30
R script for making the graphs on the US economy
##############################
# Miles Grimshaw
# April 15th, 2013
# Code for graphs exploring US Economy
# Blog Post:
##############################
getwd()
setwd("~/Desktop/Macro_Paper/Data/")
@milesgrimshaw
milesgrimshaw / gist:5172167
Created March 15, 2013 18:55
Obesity In The USA (Octopress Blog Post)
---
layout: post
title: "Obesity in the USA"
date: 2013-03-14 12:59
comments: true
categories:
---
<!-- Make sure to include D3 first or else the IIFEs won't work. -->
<script src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="/Data/obesitystatedata.js"></script>