Skip to content

Instantly share code, notes, and snippets.

View woutervdijke's full-sized avatar

Wouter van Dijke woutervdijke

View GitHub Profile
@woutervdijke
woutervdijke / OWID data bookmarklet.js
Created January 13, 2022 23:03
Bookmarklet to select data from a graph on Our World in Data, and copy it to the clipboard.
function getOwidData(){
var filteredCountry = [];
var filteredTime = [];
filteredCountry = grapher.mappableData.filter((obj) => Object.values(grapher.selection.selectedEntityNames).indexOf(obj.entityName) > -1); // first, filter the entire data set to just the selected countries
filteredTime = filteredCountry.filter((obj) => obj.time >= grapher.minTime && obj.time <= grapher.maxTime); // then, filter it further to only the selected time period
filteredTime.forEach(x => x.time = grapher.formatTime(x.time)); // convert timestamp to actual dates
filteredTime.forEach(x => x.value = x.value.toString().replace('.',',')); // convert to decimal commas for European Excel
return filteredTime;
}
@woutervdijke
woutervdijke / leafletquickstartnl.html
Created July 7, 2019 19:53
De Leaflet Quickstart, maar dan in Nederland
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="

Keybase proof

I hereby claim:

  • I am woutervdijke on github.
  • I am woutervd (https://keybase.io/woutervd) on keybase.
  • I have a public key ASAsAZ1mqSqOP4m9Jq-Keapo1JdZeCDy8B6Jr_AIfnIUFgo

To claim this, I am signing this object:

@woutervdijke
woutervdijke / textme.py
Created March 28, 2017 19:53
Python module to text myself
#! python3
# textMe.py - Defines the wouter() function that texts me a message
# passed to it as a string.
# based on 'Automate the boring stuff with Python' by Al Sweigart
# when installed in the site-packages folder where Python is installed, it
# can be called using "import textme"
# Preset values:
accountSID = 'TWILIOSID'
authToken = 'TWILIOTOKEN'