Skip to content

Instantly share code, notes, and snippets.

@itayw
itayw / head.html
Created November 20, 2013 13:35 — forked from juliangruber/head.html
requirebin sketch
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style>
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}
googleapis
.discover('analytics', 'v3')
.execute(function(err, client) {
if (err) {
utils.applog('error', {from: "lib/fetch/analytics.js", value: err, reference: "getAnalytics", resource: user_id});
return;
}
// Array that contains all request
var requests_list = [
{metrics: "ga:visits,ga:newVisits,ga:percentNewVisits,ga:newVisits,ga:pageviews,ga:visitBounceRate,ga:pageviewsPerVisit,ga:avgTimeOnSite"},
import pandas
import numpy as np
import scipy
import statsmodels.api as sm
import os
import sys
import json
import traceback
import logging
from time import time