Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Desmet peterdesmet

View GitHub Profile
@peterdesmet
peterdesmet / CONTRIBUTING.md
Last active Feb 10, 2021
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
View CONTRIBUTING.md

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 Jun 27, 2019
INBO DCAT as static file
View ipt-dcat.ttl
@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 Aug 16, 2018
Example of specifications in full text vs whip. See http://github.com/inbo/whip for more info.
View specification.md

Our specifications

occurrenceID

Every record should have an occurrenceID.

basisOfRecord

Accepted values:

@peterdesmet
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
peterdesmet / geese-species-observations-per-year.png
Last active Jun 17, 2016
Species observations for a country per year (using GBIF occurrence facets)
@peterdesmet
peterdesmet / get_gbif_datasets.py
Last active May 11, 2016
Python script to get specific metadata from GBIF-registered datasets.
View get_gbif_datasets.py
# -*- 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 Feb 11, 2016
Open Belgium 2016 blog post on Open Refine
View open-belgium-blog-post-2016.md

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 Mar 16, 2018
Bird migration forward trajectory visualizations in CartoDB
View 88c30be4-1063-11e5-a9ae-0e853d047bba.md
@peterdesmet
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
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 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