Skip to content

Instantly share code, notes, and snippets.

View khoadnguyen's full-sized avatar

Khoa Nguyen khoadnguyen

View GitHub Profile
@khoadnguyen
khoadnguyen / request.js
Created October 17, 2017 17:08 — forked from gregartemides/request.js
node-request
var request = require('request');
function serialize (obj) {
var str = [];
for(var p in obj)
if (obj.hasOwnProperty(p)) {
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
return str.join("&");
@khoadnguyen
khoadnguyen / alphavantage.py
Created October 17, 2017 17:10 — forked from femtotrader/alphavantage.py
Download data from Alphavantage http://www.alphavantage.co/ using Python, Requests and Pandas
import requests
from pandas.io.common import urlencode
from pandas.tseries.frequencies import to_offset
ALPHAVANTAGE_API_URL = "http://www.alphavantage.co/query"
ALPHAVANTAGE_API_KEY_DEFAULT = "demo"
def _init_session(session):