Skip to content

Instantly share code, notes, and snippets.

View nbortolotti's full-sized avatar
🏠
Working from home

Nicolas Bortolotti nbortolotti

🏠
Working from home
View GitHub Profile
SELECT SERVICIOINGRE, COUNT(*) FROM [mexico_open_data.Egreso_2010_2014]
Group By 1
Order By 2 DESC
Limit 10
def main(argv):
people = raw_input('G+ id to analyze? ')
postnumers = int(raw_input('number of posts '))
service, flags = sample_tools.init(
argv, 'plus', 'v1', __doc__, __file__,
scope='https://www.googleapis.com/auth/plus.me')
try:
person = service.people().get(userId=people).execute()
try:
writer = csv.writer(myfile)
writer.writerow(('id', 'content', 'test', 'replies', 'plusoners', 'resharers'))
# Information from activities
count = 0
while (count < postnumers):
activities_document = request.execute()
if 'items' in activities_document:
for activity in activities_document['items']:
@nbortolotti
nbortolotti / estado_conyugal.bq
Created September 6, 2015 00:02
Query estado_conyugal Mx
SELECT Count(ESTADO_CIVIL),ESTADO_CIVIL FROM [mexico_open_data.sinac_2008_2013]
group by 2
order by 1 DESC
<iron-pages attr-for-selected="data-route" selected="{{route}}">
<section data-route="home">
<paper-material elevation="1">
<!-- contenido -->
<mi-saludo></mi-saludo>
</paper-material>
<paper-material elevation="0">
<!-- contenido -->
</paper-material>
@nbortolotti
nbortolotti / app-comercios-modulegen
Created November 9, 2015 15:33
modulo de accesos firebase desde polymer
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/firebase-element/firebase-collection.html">
<link rel="import" href="../../bower_components/firebase-element/firebase-document.html">
<dom-module id="app-comercios">
<template>
<div class="vertical-section">
<h3>Comercios Destacados</h3>
<template is="dom-bind">
<firebase-collection
#include <DHT.h>
#include <Bridge.h>
#define DHTPIN 7
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Bridge.begin();
dht.begin();
@nbortolotti
nbortolotti / webanalysis.py
Created January 26, 2016 20:25
webanalysis scraping
def webanalysis(file):
filename =str(datetime.datetime.now()) + '.csv'
myfile = open(filename, 'wb')
try:
writer = csv.writer(myfile)
writer.writerow(('url', 'webcomponents'))
driver = webdriver.PhantomJS(
executable_path='')
@nbortolotti
nbortolotti / indexFirebaseSupportService.html
Last active March 29, 2016 18:01
Firebase implementation #SupportService
<html>
<head>
<!-- adding reference firebase.js -->
<script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
<!-- Jquery support -->
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
</head>
<body>
<div id='mensajesDiv'></div>
#open a img-file
with open(photo_file, 'rb') as image:
image_content = base64.b64encode(image.read())
service_request = service.images().annotate(
body={
'requests': [{
'image': {
'content': image_content
},
'features': [{