Skip to content

Instantly share code, notes, and snippets.


Santiago Espinosa Saigesp

Block or report user

Report or block Saigesp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Saigesp / .block
Last active Oct 19, 2018
D3v4 linear calendar
View .block
Saigesp / .block
Last active Oct 19, 2018
D3v4 Warming stripes
View .block
Saigesp /
Created Sep 23, 2018
Para recortar archivos CSV desde la linea de comandos
# -*- coding: utf-8 -*-
import sys
import csv
from collections import deque
from itertools import islice
def skip_last_n(iterator, n=1):
it = iter(iterator)
prev = deque(islice(it, n), n)
Saigesp /
Created Sep 19, 2018
Convert between projections epsg:25830 and epsg:4326 used in INE (Instituto Nacional de Estadística, Spain)
# returns latlng
def get_maxmin_latlon_region(region):
lon_max = -180
lon_min = 180
lat_max = -90
lat_min = 90
if region['type'] == 'Polygon':
for polygon in region['coordinates']:
for point in polygon:
Saigesp / .block
Last active Oct 22, 2018
D3v4 barchart with js classes
View .block
View bashrc
# Virtualenv
. /usr/share/virtualenvwrapper/
# . /usr/local/bin/ # alterntive place
# Add git branch if its present to PS1
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\] $(parse_git_branch)\[\033[00m\]\$ '
Saigesp / sublime-keymap.js
Last active Dec 12, 2018
Default (Linux).sublime-keymap
View sublime-keymap.js
{ "keys": ["ctrl+alt+b"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+alt+p"], "command": "autoprefixer" },
// console.log()
{ "keys": ["ctrl+alt+c", "ctrl+alt+o", "ctrl+alt+n"], "command": "insert_snippet", "args": {"contents": "console.log($0);"}, "context":
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }
# -*- coding: UTF-8 -*-
import os, json, time
from area import area
from termcolor import colored
# python3 -c "from fix_geojson import *; fix_geojson('ESP_MAD_adm6.json')"
def fix_geojson(filename):
Saigesp /
Created Oct 8, 2017
Function to retrieve region name based on administrative level and coordinates.
import os, json, time
import requests
from urllib.request import Request, urlopen
from termcolor import colored
debug_msg = True
def get_region_name(lat,lng,region_type):
def adm_parser(regtype):
tr = {
Saigesp / ESP_VAL_adm5.json
Last active Oct 6, 2017
Valencia neighborhoods
View ESP_VAL_adm5.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.