Skip to content

Instantly share code, notes, and snippets.

View RexGibson's full-sized avatar

Rex Gibson RexGibson

  • looker.com
  • Hastings On Hudson, NY
View GitHub Profile
#!/usr/bin/python
import re, urllib, urllib2
class Spreadsheet(object):
def __init__(self, key):
super(Spreadsheet, self).__init__()
self.key = key
class Client(object):
# to install the latest stable version:
brew install scala --with-docs
# to install scala-2.10:
brew install https://raw.github.com/gist/4340744/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.2
brew switch scala 2.10.0
CREATE OR REPLACE FUNCTION kaplan_meier(text)
RETURNS TABLE (
time_period int,
pivot text,
exposed int,
events int,
marginal_probability double precision,
cumulative_probability double precision
) AS
$PROC$
@RexGibson
RexGibson / looker_log_jsonify.py
Last active June 15, 2017 15:50 — forked from frank-kutzey/looker_log_jsonify.py
converts looker logs from plain text log to json like format - usefull for importing logs to EBK or ELK
#!/usr/bin/env python
from json import dumps
import sys
while True:
string = sys.stdin.readline()
if not string:
break