Skip to content

Instantly share code, notes, and snippets.

View fxi's full-sized avatar
🚀
Learning new things.

F.Moser fxi

🚀
Learning new things.
View GitHub Profile
@fxi
fxi / README.md
Last active May 2, 2017 14:17
Drop multiple geojson files on a mapbox gl js map

Experimental work with mapbox gl js, web workers and geojsonhint to create new layers by drag and dropping geojson data.

# demonstration de tryCatch
# exemple minimal
tryCatch(stop("yo"),error=function(cond){print(cond$message)})
# exemple en téléchargeant un fichier
superTest <- function(){
@fxi
fxi / rToSld.R
Last active April 27, 2016 12:34
raster color table to sld
library(raster)
library(XML)
# get raster file
# e.g. read from file:
r <- raster("dat.tif")
# create sample values
r <- raster(ncol=10, nrow=10)
r[] <- as.integer(runif(length(r))*255)
@fxi
fxi / postfix_part.sh
Created February 15, 2016 14:31
postfix config for vagrant ubuntu machine
if [[ ! -e $dirReceipts/postfix ]]
then
# doc found on
# https://www.linode.com/docs/email/postfix/postfix-smtp-debian7
# https://www.howtoforge.com/postfix_relaying_through_another_mailserver
export DEBIAN_FRONTEND=noninteractive
apt-get -qy purge mailutils postfix
apt-get install -qy postfix mailutils
# var
mailadmin="[email protected]"
@fxi
fxi / mxClasses.R
Last active September 24, 2015 07:11
map-x layer classes and subclasses
mxConfig$class = list(
"Development" = "dev",
"Environment" = "env",
"Extractives" = "ext",
"Stresses" = "str"
)
mxConfig$subclass = list(
"dev" = list(
"Unemployment" = "unemployment",
#'amReferralTable
#'@export
amReferralTable<-function(session=shiny:::getDefaultReactiveDomain(),inputSpeed,inputFriction,inputHf,inputHfTo,inputTblHf,inputTblHfTo,idField,idFieldTo,labelField,labelFieldTo,typeAnalysis,resol,dbCon, unitCost=c('s','m','h'),unitDist=c('m','km'),outReferral,outNearestDist,outNearestTime){
# check the clock
timeCheckAll<-system.time({
# set increment for the progress bar.
incN=0
inc=90/nrow(inputTblHf)
@fxi
fxi / Makefile
Last active August 29, 2015 14:17
#############################################################################
#
# MODULE: GRASS Compilation
# AUTHOR(S): Original author unknown - probably CERL
# Justin Hickey - Thailand - jhickey AT hpcc.nectec.or.th
# Markus Neteler - Germany - neteler AT itc.it
# Andreas Lange - Germany - Andreas.Lange AT Rhein-Main.de
# Radim Blazek - Italy - blazek AT itc.it
# PURPOSE: It provides the commands necessary to compile, install,
# clean, and uninstall GRASS
@fxi
fxi / r_utils_failed_01
Last active August 29, 2015 14:11
R.utils failed install log
------------------------------------------------- R.oo without specifing encoding in .Rprofile/ /etc/R/.Rprofile.site
> install.packages('R.oo')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/R.oo_1.18.0.tar.gz'
Content type 'application/x-gzip' length 394545 bytes (385 Kb)
opened URL
==================================================
downloaded 385 Kb
2014-11-07 12:37:48 +0100
./configure
--prefix=/usr/local/Cellar/grass-70/7.0.0beta3
--disable-debug
--disable-dependency-tracking
--enable-shared
--with-cxx
--with-python
--with-blas
2014-11-07 10:52:25 +0100
cmake
..
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/qgis/1.8.0
-DCMAKE_BUILD_TYPE=None
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
-Wno-dev
-DQWT_INCLUDE_DIR=/usr/local/opt/qwt/lib/qwt.framework/Headers/