Skip to content

Instantly share code, notes, and snippets.


Peter Desmet peterdesmet

View GitHub Profile
peterdesmet /
Last active Feb 10, 2021
My template for R packages. Released under CC0, so replace our_package, our_org, and maintainer_email and adapt as you see fit. 😌 For more info, see

Contributing to our_package

First of all, thanks for considering contributing to our_package! 👍 It's people like you that make it rewarding for us - the project maintainers - to work on our_package. 😊

our_package is an open source project, maintained by people who care. We are not directly funded to do so.

peterdesmet / ipt-dcat.ttl
Last active Jun 27, 2019
INBO DCAT as static file
View ipt-dcat.ttl
@prefix schema: <> .
@prefix dct: <> .
@prefix adms: <> .
@prefix xsd: <> .
@prefix skos: <> .
@prefix rdfs: <> .
@prefix vcard: <> .
@prefix dcat: <> .
@prefix locn: <> .
@prefix foaf: <> .
peterdesmet /
Last active Aug 16, 2018
Example of specifications in full text vs whip. See for more info.

Our specifications


Every record should have an occurrenceID.


Accepted values:

peterdesmet / doaj-apc.ipynb
Last active Sep 13, 2016
Quick analysis of the distribution of article processing charges (APC) of DOAJ journals
View doaj-apc.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
peterdesmet / geese-species-observations-per-year.png
Last active Jun 17, 2016
Species observations for a country per year (using GBIF occurrence facets)
peterdesmet /
Last active May 11, 2016
Python script to get specific metadata from GBIF-registered datasets.
# -*- coding: utf-8 -*-
import requests
import json
import csv
import sys
def get_datasets(offset, limit):
sys.stderr.write('Requesting batch {}\n'.format(offset)) # Use stderr to not contaminate stdout, which is used for the results
request = requests.get('', params={'limit': limit, 'offset': offset})
results = request.json()['results']
peterdesmet /
Last active Feb 11, 2016
Open Belgium 2016 blog post on Open Refine

Let your data shine... with OpenRefine

“Google refine is awesome. Never before have I been home this early.” - @salesient

peterdesmet /
Last active Mar 16, 2018
Bird migration forward trajectory visualizations in CartoDB
peterdesmet / belgian-lambert-to-wgs84.sql
Last active Aug 29, 2015
Transform Belgian Lambert to WGS84 in PostgreSQL
View belgian-lambert-to-wgs84.sql
-- SetSRID defines the datum. Use 31370, not 31300 for Belgian Lambert 72
ST_Transform(ST_SetSRID(ST_MakePoint(x,y),31370),4326) as geom_from_lambert,
ST_Y(ST_Transform(ST_SetSRID(ST_MakePoint(x,y),31370),4326)) as latitude_from_lambert,
ST_X(ST_Transform(ST_SetSRID(ST_MakePoint(x,y),31370),4326)) as longitude_from_lambert
FROM table_name
peterdesmet / rbins_radar_prepare_data.sql
Last active Aug 29, 2015
SQL queries to dive into the data from the RBINS radar.
View rbins_radar_prepare_data.sql
ALTER TABLE rbins_radar_occurrences
RENAME COLUMN expr1000 to date;
ALTER TABLE rbins_radar_occurrences
ALTER COLUMN area SET data type integer USING area::integer;
ALTER TABLE rbins_radar_occurrences
ALTER COLUMN av_reflectivity SET data type integer USING av_reflectivity::integer;
ALTER TABLE rbins_radar_occurrences
ALTER COLUMN date SET data type timestamp with time zone USING date::timestamp with time zone;
ALTER TABLE rbins_radar_occurrences