Skip to content

Instantly share code, notes, and snippets.

View sechilds's full-sized avatar

Stephen Childs sechilds

View GitHub Profile
@sechilds
sechilds / circle.html
Created June 28, 2019 18:50
Tooltips in D3.js
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
</head>
<style> /* set the CSS */
body { font: 12px Arial;}
path {
@sechilds
sechilds / nest_example.R
Last active July 3, 2018 15:16
Using mutate to add multi-column output from a function to a data frame.
library(tidyverse)
library(nycflights13)
library(purrr)
#small data frame of new years day flights from JFK
df1<-flights %>% filter(year==2013,month==1,day==1,origin=="JFK")
# test function -- I dropped the lubridate because `dep_time` is actually an integer.
# I also changed it -- so that the function takes a whole data frame
arr_gate_time <- function(df) {
@sechilds
sechilds / keybase.md
Created June 25, 2017 13:33
Keybase Proof

Keybase proof

I hereby claim:

  • I am sechilds on github.
  • I am sechilds (https://keybase.io/sechilds) on keybase.
  • I have a public key ASCjz9CrGebmpT2p82qxVCy7Zq1te9lAWqOu63_2ElUDVgo

To claim this, I am signing this object:

@sechilds
sechilds / fake_data.ipynb
Created April 20, 2016 13:12
Fake Data Generation Process
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sechilds
sechilds / Tableau_Filter.md
Last active July 25, 2018 22:28
git filter to strip the thumnails from a tableau workbook.

Filter Tableau Workbook Thumbnails

This is a git filter to strip the thumnails from a tableau workbook.

To install, store a copy of this file into your $PATH. Git looks for a script to run that takes a file in as standard input and outputs a text file.

Then you need to tell git about the filter

git config --global filter.tableau.smudge "tableau_clean_thumnails.py"

@sechilds
sechilds / keybase.md
Created June 13, 2014 11:10
keybase.io proof

Keybase proof

I hereby claim:

  • I am sechilds on github.
  • I am sechilds (https://keybase.io/sechilds) on keybase.
  • I have a public key whose fingerprint is DFA2 1B24 8E19 608D AD5A 79E2 F506 C01E FE7D EFFC

To claim this, I am signing this object:

@sechilds
sechilds / earnings.do
Created December 16, 2013 11:57
Code for earnings growth analysis using the SLID from Kevin Milligan's blog post: [Earnings Growth : Kevin Milligan](http://blogs.ubc.ca/kevinmilligan/2013/12/15/earnings-growth/). He posted it on the UBC site. I just throughout it should be posted to github as well. Kudos for posting the code!
* Kevin Milligan
* UBC Economics
* kevin.milligan@ubc.ca
*********************************************
* Program name: earnigns.do
* Created: December 15, 2013
* Updated: December 15, 2013
*********************************************
clear
@sechilds
sechilds / change_date_format.py
Created July 1, 2012 14:05
Update File Names to use new date format
#!/usr/bin/env python
"""
Author: Stephen Childs (based on rename.py by Matt Weber)
Date: 2012-07-01
Renames files based on the input options.
"""
import os
import sys
@sechilds
sechilds / childs-quix-d.txt
Created February 13, 2012 12:58
Merlin Mann's Custom Quix Commands
> Stephen Childs's Copy Merlin Mann's Custom Quix Commands
> TITLE: childs-quix-d.txt
> REMARKS: Hello, world. Under construction. Dilute! Dilute!
> GITHUB: http://gist.github.com/290059
> MORE: http://quixapp.com
> UPDATED: 2010-02-07_13-07-54
@Merlin Mann's Custom Quix Commands
@May organize these better once they all stabilize
>bit javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0); Make a bit.ly link
>cal javascript:var%20s;if(window.getSelection){s=window.getSelection();}else{s=document.selection.createRange().text;}var%20t=prompt('Please%20enter%20a%20description%20for%20the%20event',s);if(t){void(window.open(encodeURI('http://www.google.com/calendar/event?ctext='+t+'&action=TEMPLATE&pprop=HowCreated%3AQUICKADD'),'gcal'));}else{void(s);} Add event to Google Calendar