Skip to content

Instantly share code, notes, and snippets.

View Enchufa2's full-sized avatar

Iñaki Ucar Enchufa2

View GitHub Profile
@Enchufa2
Enchufa2 / get_wikipedia_events.py
Last active November 26, 2016 22:21
Download all events, births and deaths from Wikipedia
#!/usr/bin/env python3
# coding=UTF8
# Author: Iñaki Ucar <i.ucar86@gmail.com>
# Description: Download all events, births and deaths from Wikipedia
import sys, requests, locale
from datetime import date, timedelta as td
from pypandoc import convert # <3
MAX_TITLES = 50
@jeroen
jeroen / readme.md
Last active January 17, 2017 17:21
Testing R packages on Solaris
@markusstraub
markusstraub / cloudsend.sh
Last active December 16, 2019 13:57 — forked from MG2R/cloudsend.sh
Send files to Nextcloud/Owncloud shared folder using curl
#!/usr/bin/env bash
############################################################
#
# cloudsend.sh
#
# Uses curl to send files to a shared
# Nextcloud/Owncloud folder
#
# Usage: ./cloudsend.sh <file> <folderLink>
@hroncok
hroncok / micro-bindings.json
Last active July 1, 2020 17:21
My micro key bindings to simulate what I'm used to in bash, ipython and geany
{
"CtrlLeft": "WordLeft",
"CtrlRight": "WordRight",
"CtrlShiftLeft": "SelectWordLeft",
"CtrlShiftRight": "SelectWordRight",
"CtrlUp": "MoveLinesUp",
"CtrlDown": "MoveLinesDown",
"CtrlShiftHome": "SelectToStart",
"CtrlShiftEnd": "SelectToEnd",
"CtrlW": "DeleteWordLeft",
@Enchufa2
Enchufa2 / cchecks-rules.R
Last active September 24, 2020 16:58
This snippet monitors your R packages' CRAN Package Check Results page and notifies you by email if there are any changes.
#remotes::install_github("ropensci/cchecks")
library(cchecks)
myaddress <- whoami::email_address()
# cchn_register(myaddress)
pkgs <- cch_maintainers(sub("@", "_at_", myaddress))$data$packages
msgs <- c("warn", "error")
rules <- lapply(pkgs$package, function(pkg) list(package=pkg))
@Enchufa2
Enchufa2 / git-remove.sh
Last active September 17, 2021 12:10
Remove and purge old mistakes and/or unwanted big files from git history
#!/bin/bash
# Remove and purge old mistakes and/or unwanted big files from git history
# author: Iñaki Ucar <i.ucar86@gmail.com>
# based on: http://blog.ostermiller.org/git-remove-from-history
if [ "$#" -ne 2 ]; then
echo "usage: $0 <repo-URL> <pattern>"
exit 1
fi
@ellisp
ellisp / dualplot.R
Last active February 28, 2023 15:45
dualplot <- function(x1, y1, y2, x2 = x1,
col = c("#C54E6D", "#009380"),
lwd = c(1, 1), colgrid = NULL,
mar = c(3, 6, 3, 6) + 0.1,
ylab1 = paste(substitute(y1), collapse = ""),
ylab2 = paste(substitute(y2), collapse = ""),
nxbreaks = 5,
yleg1 = paste(gsub("\n$", "", ylab1), "(left axis)"),
yleg2 = paste(ylab2, "(right axis)"),
ylim1 = NULL, ylim2 = NULL, ylim.ref = NULL,
@rCarto
rCarto / mtq.R
Last active August 21, 2023 19:06
library(raster)
library(cartography)
library(sf)
library(SpatialPosition)
mtq <- st_read(system.file("shape/martinique.shp", package="cartography"))
# use WGS84 proj
mtq_latlon <- st_transform(mtq, 4326)
# this call throw an error but seems to work...
getData('SRTM', lon=-61, lat=14)