Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Roberto Salas robsalasco

🏠
Working from home
View GitHub Profile
View salamanca_graph.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:32369e64aaff29a812e86e2e2a97e7ca
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const searchParams = new URL(request.url).searchParams
let url = searchParams.get('url')
if (url && !url.match(/^[a-zA-Z]+:\/\//)) url = 'http://' + url
@robsalasco
robsalasco / config.fish
Created Nov 29, 2021
Default fish config
View config.fish
set -U fish_greeting "🐟"
set -Ux RSTUDIO_WHICH_R /usr/local/bin/R
set -Ux EDITOR /usr/local/bin/subl
set default_path /usr/bin /usr/sbin /bin /sbin
set homebrew_arm /opt/homebrew/bin /opt/homebrew/sbin
set homebrew_x86 /usr/local/bin /usr/local/sbin
set architecture (arch)
View escaños.R
library(jsonlite)
library(purrr)
library(stringr)
library(tibble)
library(tidyr)
library(janitor)
library(glue)
extract_results <- function(distrito) {
g <- read_json(glue("https://www.servelelecciones.cl/data/elecciones_convencionales_g/computo/distritos/60{distrito}.json"),
View circulo.md
library(ggforce)
#> Loading required package: ggplot2

circulo <- data.frame(
  x = 0,
  y = 0,
  r = 1
)
View gist:d0e5da3b5b0a39419bce35836a614529
library(sf)
#> Linking to GEOS 3.8.1, GDAL 3.1.1, PROJ 7.1.0
library(tmap)
library(purrr)
library(jsonlite)
#> 
#> Attaching package: 'jsonlite'
#> The following object is masked from 'package:purrr':
#> 
View logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View corona.py
from requests import get
from lxml import html, etree
import camelot
import pandas as pd
import numpy as np
url = 'https://www.minsal.cl/nuevo-coronavirus-2019-ncov/casos-confirmados-en-chile-covid-19/'
response = get(url)
View corona.py
from requests import get
from lxml import html, etree
import camelot
import pandas as pd
import numpy as np
url = 'https://www.minsal.cl/nuevo-coronavirus-2019-ncov/casos-confirmados-en-chile-covid-19/'
response = get(url)
View corona.py
from requests import get
from lxml import html, etree
import camelot
import pandas as pd
import numpy as np
url = 'https://www.minsal.cl/nuevo-coronavirus-2019-ncov/casos-confirmados-en-chile-covid-19/'
response = get(url)