Skip to content

Instantly share code, notes, and snippets.

View tobyjsullivan's full-sized avatar

Toby Sullivan tobyjsullivan

View GitHub Profile
@tobyjsullivan
tobyjsullivan / S&P500Dividends.csv
Created April 18, 2016 16:42 — forked from adamcrosby/S&P 500 Dividends
S&P500Dividends.csv
Symbol Name Dividend/Share Earning/Share Dividend Yield
MMM 3M Company Common 2.45 6.34 2.11
ABT Abbott Laboratori 0.6641 2.507 1.85
ANF Abercrombie & Fit 0.75 3.077 1.52
ACE Ace Limited Commo 2.47 7.825 2.61
ADBE Adobe Systems Inc 0.00 1.125 N/A
AMD Advanced Micro De 0.00 -1.137 N/A
AES The AES Corporati 0.12 -1.567 0.94
AET Aetna Inc. Common 0.775 4.841 1.20
ACS ACS N/A N/A N/A
@tobyjsullivan
tobyjsullivan / nasdaqlist.csv
Last active April 18, 2016 16:41 — forked from huangt/nasdaqlist.csv.py
list of stock symbol on Nasdaq
Symbol Name LastSale MarketCap ADR TSO IPOyear Sector industry Summary Quote
FLWS 1-800 FLOWERS.COM, Inc. 5.27 336424668.5 n/a 1999 Consumer Services Other Specialty Stores http://www.nasdaq.com/symbol/flws
FCTY 1st Century Bancshares, Inc 7.6 70281022.8 n/a n/a Finance Major Banks http://www.nasdaq.com/symbol/fcty
FCCY 1st Constitution Bancorp (NJ) 10.13 60727141.66 n/a n/a Finance Savings Institutions http://www.nasdaq.com/symbol/fccy
SRCE 1st Source Corporation 26.8 653265946 n/a n/a Finance Major Banks http://www.nasdaq.com/symbol/srce
FUBC 1st United Bancorp, Inc. (FL) 7.37 252695602.7 n/a n/a Finance Major Banks http://www.nasdaq.com/symbol/fubc
VNET 21Vianet Group, Inc. 15.97 943028500 n/a n/a Technology Computer Software: Programming, Data Processing http://www.nasdaq.com/symbol/vnet
JOBS 51job, Inc. 66.49 1954129996 n/a 2004 Technology Diversified Commercial Services http://www.nasdaq.com/symbol/jobs
EGHT 8x8 Inc 9.805 713472326.3 n/a n/a Public Utilities Telecommunications Equipment http
// Request: Fetch properties in Vancovuer
curl 'http://www.realtor.ca/api/Listing.svc/PropertySearch_Post' -H 'Pragma: no-cache' -H 'Origin: http://www.realtor.ca' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H 'Referer: http://www.realtor.ca/Map.aspx' -H 'Cookie: GUID=abbeab92-dcc7-40ae-9755-29c946d3ed90; CookieConverted=TRUE; TargetPage=/Map.aspx#CultureId=1&ApplicationId=1&Longitude=-124.917999267578&Latitude=49.7136993408203&PropertyTypeId=300&TransactionTypeId=2&PriceMin=0&PriceMax=0&BedRange=0-0&BathRange=0-0&ZoomLevel=12&undefined; TermsOfUseAgreement=ACCEPTED; __utmt=1; _dc_gtm_UA-12908513-11=1; _gali=Label1; __utma=134851954.1582663285.1427615646.1427615646.1428641581.2; __utmb=134851954.4.9.1428641603962; __utmc=134851954;
@tobyjsullivan
tobyjsullivan / gist:9bcef70406df23b1d7b7
Last active August 29, 2015 14:15
NP2 CuRL Responses
// ---- LOGIN
curl 'http://triton.ironhelmet.com/arequest/login' -H 'Origin: http://triton.ironhelmet.com' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: http://triton.ironhelmet.com/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'type=login&alias=tobyjsullivan&password=<URL_ENCODED_PASSWORD>' --compressed
// Response:
Adding handle: conn: 0x7fd9c9004400
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fd9c9004400) send_pipe: 1, recv_pipe: 0
* About to connect() to triton.ironhelmet.com port 80 (#0)
/**
* Based on the S3N RDD gist from Jeremy Pierre https://gist.github.com/j14159/d3cbe172f7b962d74d09
*
* Modified to use Jets3t
*/
package net.tobysullivan.spark.rdd
import java.io.{BufferedInputStream, BufferedReader, InputStreamReader}
import java.util.zip.GZIPInputStream