Skip to content

Instantly share code, notes, and snippets.

View cbertelegni's full-sized avatar

Cristian Bertelegni cbertelegni

View GitHub Profile
@cbertelegni
cbertelegni / .block
Last active March 23, 2019 14:56
Sociedades donde aparece el apellido MACRI desde 2010
license: mit
height: 2000
scrolling: yes
border: yes
@cbertelegni
cbertelegni / .block
Created January 30, 2019 03:06
Ellipse d3js
license: mit
scrolling: yes
@cbertelegni
cbertelegni / README.md
Created May 24, 2018 19:08
documentacion routes map

Ruotes Map d3js & leafleft

Mapa reutilizable que usa como fuente de datos Google Spreadsheet

Spreadsheet de ejemplo

Parámetros para el permalink:

  • gkey: El id del Google Spreadsheet, ej: "1kr4QxM_VgIsKhGL9b_ystBzQR1bSFSLwhLVw2yY9-E0"
@cbertelegni
cbertelegni / .bashrc
Created May 16, 2018 20:36
Custom bash status
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
@cbertelegni
cbertelegni / ranking_json_to_csv.py
Created September 19, 2017 22:23
Congresoscopio: convierte el json de ranking en csv
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import csv
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
@cbertelegni
cbertelegni / logger.py
Created April 26, 2017 19:33
Configuracion de logger de python
import os
import logging
from logging.handlers import RotatingFileHandler
LOG_FORMAT = '%(levelname)s:%(name)s:%(funcName)s(L%(lineno)d):%(asctime)s: %(message)s'
folder_logs = 'logs'
def get_logger(name=__name__, log_file_name='logger.log', log_level=logging.WARNING):
file_path = os.path.join(folder_logs, log_file_name)
@cbertelegni
cbertelegni / comandos_bianca.md
Created February 6, 2017 21:40
Comandos más utilizados en books16

Equipo Diseño LN

Actualizar el repositorio Git antes de hacer un push

git status # para ver los cambios
git commit -am "mensaje del commit" # si hay archivos nuevos agregarlos con git add nombre_del_archivo
git pull origin master # trae los últimos cambios del repo de github antes de hacer push
git push origin master # sube los cambios a github para que esten disponibles para todos
@cbertelegni
cbertelegni / descargar_books16_ln.bash
Last active January 31, 2017 20:46
Script para descagar books16 para La Nacion Data
#! /bin/bash
# path del script.
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
PJ_FOLDER=books16
VENV=venv_books16
GIT_REPOSITORY="https://github.com/lanacioncom/books16.git"
/**
* Escrapear datos desde la consola con javascript
*/
var wrap = document.querySelectorAll("div#contenido > div")[5];
var tables = wrap.querySelectorAll("table tbody");
var data = [];
tables.forEach(function(t){
var r = [];
t.querySelectorAll("td").forEach(function(txt){
require.config({
paths: {
"pym": "http://especiales.lanacion.com.ar/multimedia/proyectos/js/pym.min"
},
waitSeconds: 40
});
require( ["pym"],
function (pym) {