Skip to content

Instantly share code, notes, and snippets.

Avatar

Iñaki Ucar Enchufa2

View GitHub Profile
@markusstraub
markusstraub / cloudsend.sh
Last active Dec 16, 2019 — forked from MG2R/cloudsend.sh
Send files to Nextcloud/Owncloud shared folder using curl
View cloudsend.sh
#!/usr/bin/env bash
############################################################
#
# cloudsend.sh
#
# Uses curl to send files to a shared
# Nextcloud/Owncloud folder
#
# Usage: ./cloudsend.sh <file> <folderLink>
View mtq.R
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)
@hroncok
hroncok / micro-bindings.json
Last active Jul 1, 2020
My micro key bindings to simulate what I'm used to in bash, ipython and geany
View micro-bindings.json
{
"CtrlLeft": "WordLeft",
"CtrlRight": "WordRight",
"CtrlShiftLeft": "SelectWordLeft",
"CtrlShiftRight": "SelectWordRight",
"CtrlUp": "MoveLinesUp",
"CtrlDown": "MoveLinesDown",
"CtrlShiftHome": "SelectToStart",
"CtrlShiftEnd": "SelectToEnd",
"CtrlW": "DeleteWordLeft",
@Enchufa2
Enchufa2 / git-remove.sh
Last active Sep 17, 2021
Remove and purge old mistakes and/or unwanted big files from git history
View git-remove.sh
#!/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
@Enchufa2
Enchufa2 / get_wikipedia_events.py
Last active Nov 26, 2016
Download all events, births and deaths from Wikipedia
View get_wikipedia_events.py
#!/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
View dualplot.R
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,
@Enchufa2
Enchufa2 / cchecks-rules.R
Last active Sep 24, 2020
This snippet monitors your R packages' CRAN Package Check Results page and notifies you by email if there are any changes.
View cchecks-rules.R
#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))
@jeroen
jeroen / readme.md
Last active Jan 17, 2017
Testing R packages on Solaris
View readme.md