Skip to content

Instantly share code, notes, and snippets.

View soubhik-khan's full-sized avatar
🎯
Focusing

Soubhik soubhik-khan

🎯
Focusing
  • California
View GitHub Profile
@soubhik-khan
soubhik-khan / gist:4c40cc645bec9d76bd4455a84fe925c6
Created October 18, 2016 05:45 — forked from wetzler/gist:6909882
This gist shows you how to run a retention analysis. I blogged about how to run a retention analysis here: https://keen.io/blog/47823687779/how-to-do-a-retention-analysis/
require 'rubygems'
require 'keen'
require 'json'
require 'date'
require 'active_support/all' #for datetime calculation e.g. weeks.ago.at_beginning_of_week
require 'simple_xlsx' #for outputting excel files
require 'cgi' #for URL encoding
#================================oOo===================================

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream