Skip to content

Instantly share code, notes, and snippets.

View chyikwei's full-sized avatar

Chyi-Kwei Yau chyikwei

View GitHub Profile
@chyikwei
chyikwei / gist:6366467
Created August 28, 2013 14:13
cohorts analysis script
import random as rand
from string import Template
from itertools import repeat
from datetime import datetime, timedelta
from apps.glue.util.date import start_of_next_month
from apps.dashboard.views import get_bigquery, get_signup_tables, get_interaction_tables
from apps.dashboard.views import datetime_human, date_range2, date_name
bq = get_bigquery()
@chyikwei
chyikwei / gist:6357723
Created August 27, 2013 19:09
pull objects feeds
import bz2
import os
import re
import random
import csv
from urlparse import urlparse
#old bz2 files
#path = '/logs/prod/nginx/2013/06'
path = '/var/log/remote/prod/nginx/2013/08'