Skip to content

Instantly share code, notes, and snippets.

View peterdesmet's full-sized avatar

Peter Desmet peterdesmet

View GitHub Profile
@peterdesmet
peterdesmet / CONTRIBUTING.md
Last active October 11, 2024 12:20
My CONTRIBUTING.md 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 https://help.github.com/articles/setting-guidelines-for-repository-contributors

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
peterdesmet / ipt-dcat.ttl
Last active June 27, 2019 08:57
INBO DCAT as static file
@prefix schema: <http://schema.org/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix adms: <http://www.w3.org/ns/adms#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@peterdesmet
peterdesmet / specification.md
Last active August 16, 2018 11:50
Example of specifications in full text vs whip. See http://github.com/inbo/whip for more info.

Our specifications

occurrenceID

Every record should have an occurrenceID.

basisOfRecord

Accepted values:

@peterdesmet
peterdesmet / doaj-apc.ipynb
Last active September 13, 2016 13:08
Quick analysis of the distribution of article processing charges (APC) of DOAJ journals
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterdesmet
peterdesmet / geese-species-observations-per-year.png
Last active June 17, 2016 15:16
Species observations for a country per year (using GBIF occurrence facets)
geese-species-observations-per-year.png
@peterdesmet
peterdesmet / get_gbif_datasets.py
Last active May 11, 2016 07:51
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('http://api.gbif.org/v1/dataset/', params={'limit': limit, 'offset': offset})
results = request.json()['results']
@peterdesmet
peterdesmet / open-belgium-blog-post-2016.md
Last active February 11, 2016 11:13
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
peterdesmet / 88c30be4-1063-11e5-a9ae-0e853d047bba.md
Last active March 16, 2018 14:29
Bird migration forward trajectory visualizations in CartoDB
@peterdesmet
peterdesmet / belgian-lambert-to-wgs84.sql
Last active August 29, 2015 14:07
Transform Belgian Lambert to WGS84 in PostgreSQL
-- SetSRID defines the datum. Use 31370, not 31300 for Belgian Lambert 72
SELECT
*,
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
peterdesmet / rbins_radar_prepare_data.sql
Last active August 29, 2015 14:07
SQL queries to dive into the data from the RBINS radar.
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