I hereby claim:
- I am enkeboll on github.
- I am enkeboll (https://keybase.io/enkeboll) on keybase.
- I have a public key ASAFYSl9y480O-OPtLFBOEA-F5508UFKGk6G3p57BQGk7Qo
To claim this, I am signing this object:
| __author__ = 'andyenkeboll' | |
| import requests | |
| # on mac, `sudo pip install facebook-sdk` | |
| # https://pypi.python.org/pypi/facebook-sdk | |
| import facebook | |
| from collections import Counter | |
| # `sudo pip install mechanize` | |
| import mechanize | |
| import re |
| import random | |
| def main(): | |
| teams = ["Patriots","Seahawks"] | |
| ones = {"Patriots": range(10), | |
| "Seahawks": range(10)} | |
| random.shuffle(teams) | |
| for team in teams: | |
| random.shuffle(ones[team]) |
| import urllib2 | |
| from os import path | |
| from urlparse import urlsplit | |
| dir = path.join(path.expanduser("~"),'Downloads') | |
| url = "http://thebos.co/e/venmohq-celebration" | |
| page = urllib2.urlopen(url).read() | |
| soup = BeautifulSoup(page) |
| #!/usr/bin/osascript | |
| # This is my version of | |
| # http://peterdowns.com/posts/open-iterm-finder-service.html | |
| # modified for iTerm 2.9+ | |
| # Create this as an "Application", save it as a .app file, and | |
| # drag it onto the Finder window while holding the command key | |
| # (in Yosemite, the command and option keys) | |
| on run {input, parameters} |
| import csv | |
| import requests | |
| from bs4 import BeautifulSoup | |
| base_url = "http://www.pro-football-reference.com" | |
| next_page = "/super-bowl/i.htm" | |
| # this website doesn't have a "next" button to SB XLIX, for some reason | |
| extra = ['/super-bowl/xlix.htm'] | |
| def pair(a, b): |
I hereby claim:
To claim this, I am signing this object:
| import bisect | |
| import datetime | |
| import operator | |
| import boto3 | |
| client = boto3.client('cloudwatch') | |
| def get_metric(offset, metricname, threshold, oper='ge', stat='Average'): | |
| if offset >= 64: |
| create_table = """ | |
| DROP TABLE IF EXISTS `dec_test`; | |
| CREATE TABLE `dec_test` ( | |
| `dec_2_2` decimal(4,2), | |
| `dec_4_2` decimal(6,2), | |
| `dec_8_4` decimal(8,4), | |
| `char_15` char(15) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| insert into dec_test values |
| # from http://blogs.quovantis.com/how-to-convert-csv-to-parquet-files/ | |
| from pyspark import SparkContext | |
| from pyspark.sql import SQLContext | |
| from pyspark.sql.types import StructField, StructType, IntegerType, StringType, TimestampType | |
| if __name__ == "__main__": | |
| sc = SparkContext(appName="CSV2Parquet") | |
| sqlContext = SQLContext(sc) |
| redshift | |
| -- COMMAND LINE CONNECT: | |
| - seatgeek: | |
| - psql "host=redshift-datawarehouse.service.seatgeek.prod dbname=sganalytic user=andy port=5439" | |
| - greenhouse: | |
| - psql "host=redshift.greenhouse.io dbname=greenhouse user=org_978 port=5439 sslmode=require" | |
| -- CREDENTIALS LINE | |
| CREDENTIALS 'aws_iam_role=arn:aws:iam::093535234988:role/Production-RedshiftCopyUnload' |