$ uname -r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(shinyjs) | |
if (!dir.exists('www/')) { | |
dir.create('www') | |
} | |
download.file( | |
url = 'https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js', | |
destfile = 'www/js.cookie.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
apt-get install openjdk-8-jre | |
# PostgreSQL and PostGIS | |
apt-get install postgresql postgresql-contrib postgis postgresql-10-postgis-2.4 | |
# Create "geoserver" database | |
sudo -u postgres createuser -P geoserver | |
sudo -u postgres createdb -O geoserver geoserver | |
sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" geoserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo %0.bat - Reading all Shapefiles from a directory into a GeoPackage file | |
rem Constants | |
set version=Version 0.1 | |
set outfile=geopackage.gpkg | |
rem Checking if OGR is installed and in program path | |
ogr2ogr --version >nul | |
if not %errorlevel%==0 goto ogrnotfound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(dplyr) | |
library(ggplot2) | |
innerModUI <- function(id) { | |
ns <- NS(id) | |
fluidPage(fluidRow( | |
uiOutput(ns("inner_slider")), |
The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.
If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output) { | |
datasetInput <- reactive({ | |
switch(input$dataset, | |
"rock" = rock, | |
"pressure" = pressure, | |
"cars" = cars) | |
}) | |
output$caption <- renderText({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Browser fingerprinting is a technique to "mark" anonymous users using JS | |
// (or other things). To build an "identity" of sorts the browser is queried | |
// for a list of its plugins, the screen size and several other things, then | |
// hashes them. The idea is that these bits of information produce an unique | |
// "fingerprint" of sorts; the more elaborate the list of data points is, the | |
// more unique this fingerprint becomes. And you wouldn't even need to set a | |
// cookie to recognize this user when she visits again. | |
// | |
// For more information on this topic consult | |
// [Ars Technica](http://arstechnica.com/tech-policy/news/2010/05/how-your-web-browser-rats-you-out-online.ars) |