Skip to content

Instantly share code, notes, and snippets.

View gregmacfarlane's full-sized avatar

Greg Macfarlane gregmacfarlane

View GitHub Profile
@dereckmezquita
dereckmezquita / Makevars
Last active April 8, 2023 17:52
Makevars and instructions for installing installing data.table on an M1 Mac; note config also works for installing slam/syuzhet.
# if you downloaded llvm manually above, replace with your chosen NEW_PATH/clang
LLVM_LOC = /opt/homebrew/opt/llvm
CC=$(LLVM_LOC)/bin/clang -fopenmp
CXX=$(LLVM_LOC)/bin/clang++ -fopenmp
# -O3 should be faster than -O2 (default) level optimisation ..
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L/opt/homebrew/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib
CPPFLAGS=-I/opt/homebrew/opt/gettext/include -I$(LLVM_LOC)/include
@filipkral
filipkral / convert_sp_geojson.r
Last active May 17, 2021 15:21
Convert between geojson and sp spatial objects in R
# Convert between geojson and sp spatial objects in R
require(rgdal)
# https://stat.duke.edu/~cr173/Sta523_Fa14/spatial_data.html
s <- '{ "type": "MultiPolygon", "coordinates": [
[ [[40, 40], [20, 45], [45, 30], [40, 40]] ],
[ [[20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35]],
[[30, 20], [20, 15], [20, 25], [30, 20]]
]
]}'