Skip to content

Instantly share code, notes, and snippets.

View greimel's full-sized avatar

Fabian Greimel greimel

View GitHub Profile
### A Pluto.jl notebook ###
# v0.19.15
using Markdown
using InteractiveUtils
# ╔═╡ 2af94a73-953b-4e45-9b09-e6e95bb7eced
using Dates
# ╔═╡ cbc821e3-e405-4479-9284-119f6382e6b0
@greimel
greimel / wglmakie.jl
Created January 14, 2022 12:49
Pluto.jl notebook testing WGLMakie.jl
### A Pluto.jl notebook ###
# v0.17.3
using Markdown
using InteractiveUtils
# ╔═╡ 1cf23ca6-7523-11ec-3a39-4db74b5a3050
begin
using WGLMakie
import JSServe
@greimel
greimel / aog-nb.jl
Last active January 13, 2021 08:46
AoG enhancement proposal (Pluto notebook)
### A Pluto.jl notebook ###
# v0.12.18
using Markdown
using InteractiveUtils
# ╔═╡ da555184-53f0-11eb-3d52-378fc5a3ae93
begin
using Pkg
Pkg.activate(temp=true)
@greimel
greimel / two-variables.jl
Last active November 6, 2020 19:57
Pluto on binder test
### A Pluto.jl notebook ###
# v0.12.4
using Markdown
using InteractiveUtils
# ╔═╡ 9dc3d954-16b3-11eb-2402-c7f683027456
begin
using Pkg: Pkg, @pkg_str
Pkg.activate(mktempdir())
using Pkg
pkg"activate polygons"
pkg"add Shapefile#sd/geometrybasics"
pkg"add AbstractPlotting#sd/geom_merge"
pkg"add GeometryBasics#sd/polygons"
pkg"add GLMakie CairoMakie"
using Shapefile
using AbstractPlotting, GLMakie
#using CairoMakie
@greimel
greimel / germany.jl
Created August 10, 2020 13:38
Plotting maps of Germany with Plots.jl
using Shapefile
using DataFrames, Missings
using Underscores
import Plots
url_gadm = "https://biogeo.ucdavis.edu/data/gadm3.6/shp/gadm36_DEU_shp.zip"
zip_archive = download(url_gadm) # 29 MB
dir = mktempdir()
run(`unzip $zip_archive -d $dir`)
@greimel
greimel / joining.R
Created April 22, 2020 09:46
cleaning SCF
library("haven")
library("data.table")
#library("ggplot2")
wd <- getwd()
#setwd("scf-data")
#setwd(wd)
### SCF 1989--2016
scf89 <- read_dta("raw-data-2018/rscfp1989.dta")
scf92 <- read_dta("raw-data-2018/rscfp1992.dta")
scf95 <- read_dta("raw-data-2018/rscfp1995.dta")
@greimel
greimel / distance_grid.jl
Created February 5, 2020 14:50 — forked from jkrumbiegel/distance_grid.jl
get a grid of distances and durations between one location and a grid of locations
using HTTP
using Dates
using Printf
using JSON
using DataFrames
using CSV
hbf_location = "53.5527704,10.0065856"
@greimel
greimel / unpack-or-not-unpack.jl
Created January 31, 2018 15:07 — forked from anonymous/unpack-or-not-unpack.jl
Should we unpack in inner or outer function?
using Parameters
type Par{T <: Real}
α::T
β::T
end
### Implementation 1: unpack in outer function
function f1(x::T, y::T, α::T, β::T) where T <: Real
x^α * y^β