Skip to content

Instantly share code, notes, and snippets.

View Saigesp's full-sized avatar
🙄

Santiago Espinosa Saigesp

🙄
View GitHub Profile
@Saigesp
Saigesp / .block
Last active October 19, 2018 18:11
D3v4 feverchart with linear regression
281f92fae4192c4a569fc992d10a9914
@Saigesp
Saigesp / .block
Last active October 19, 2018 18:11
D3v4 linear calendar
a0b505c3d0e42cfbdf39b0d2c19ada0c
@Saigesp
Saigesp / .block
Last active July 9, 2021 00:36
D3v4 Warming stripes
eda813560c801474904004d6b6b1cc4c
@Saigesp
Saigesp / translate_ine_projection.py
Created September 19, 2018 18:29
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
Saigesp / .block
Last active October 22, 2018 04:06
D3v4 barchart with js classes
f906ae2bab36f03a59c78e8d669aa68c
@Saigesp
Saigesp / bashrc
Last active September 3, 2023 16:21
# Virtualenv
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
# 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
Saigesp / sublime-keymap.js
Last active December 12, 2018 12:03
Default (Linux).sublime-keymap
[
{ "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):
try:
@Saigesp
Saigesp / ESP_VAL_adm5.json
Last active October 6, 2017 20:10
Valencia neighborhoods
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Saigesp
Saigesp / ESP_MAD_adm5.json
Last active October 6, 2017 18:30
Madrid neighborhoods
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.