Skip to content

Instantly share code, notes, and snippets.

View ethanwhite's full-sized avatar

Ethan White ethanwhite

View GitHub Profile
@ethanwhite
ethanwhite / gource-multiple-repositories.sh
Created May 2, 2012 15:14 — forked from anonymous/gource-multiple-repositories.sh
Generates gource video out of multiple repositories.
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <this.sh> /path/to/repo1 /path/to/repo2
i=0
for repo in $*; do
# 1. Generate a Gource custom log files for each repo. This can be facilitated by the --output-custom-log FILE option of Gource as of 0.29:
logfile="$(mktemp /tmp/gource.XXXXXX)"
@ethanwhite
ethanwhite / plot_data_w_pandas.py
Created May 28, 2012 03:20
A simpler version of Michael Hansen's temperature trend example using Pandas
"""Trying Michael Hansen's temperature trend example using Pandas
The original example, without Pandas, is available at:
http://software-carpentry.org/2012/05/an-exercise-with-matplotlib-and-numpy/
"""
import os
import pandas
import numpy as np
import matplotlib.pyplot as pyplot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ethanwhite
ethanwhite / nbviewer_bookmarklet.js
Created October 17, 2012 01:33 — forked from jiffyclub/nbviewer_bookmarklet.js
A bookmarklet that tries to open the current page in nbviewer. White space has been trimmed for brevity. To use make a new bookmark and copy the code below into the URL field.
javascript:date=new Date();
url_root='http://nbviewer.ipython.org/';
url=null;
gist=location.href.match(/^https?:\/\/gist.github.com\/([0-9]+)$/);
if (gist) {
url = url_root + gist[1];
} else {
path=location.href.match(/^https?:\/\/(.*\.ipynb)$/);
if (path) {
url=url_root + 'url/' + path[1];}}
@ethanwhite
ethanwhite / testing_in_ipynb.ipynb
Created November 1, 2012 20:56
Testing in an IPython Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<body>
<script type="text/javascript" src="http://impactstory.org/embed/v1/impactstory.js"></script>
<div class="impactstory-embed" id="impactstory" data-id="19210768" data-id-type="pmid" data-api-key="API-DOCS"></div>
</body>
</html>
@ethanwhite
ethanwhite / python_ggplot_exploration.ipynb
Created October 16, 2013 02:12
Experimenting with ggplot in Python.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ethanwhite
ethanwhite / python_excel_dates.ipynb
Last active August 29, 2015 13:58
Testing the Excel date import problem in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Benefits of version control

  • Track changes on steroids

    • Tracks every change ever made in groups called commits
    • Every commit stores the full state of all of your files at that time
    • Never lose anything
    • Easily unbreak your code/data/manuscript
    • No more file name changes
  • Collaboration

@ethanwhite
ethanwhite / read_csv_high_decimal_places.md
Last active August 29, 2015 14:02
read.csv() with too many decimal places

It appears that read.csv() converts floats to factors if they have a large number of decimal places.

Data files

test_works.csv:

a,b
1.255,2.993
1.834,2.555