Skip to content

Instantly share code, notes, and snippets.

View daanlouter's full-sized avatar

Daan Louter daanlouter

View GitHub Profile
@daanlouter
daanlouter / rdio_pl_export.js
Last active December 15, 2015 16:18
Export your Rdio Collection to a spotify playlist
javascript:(function() {
var bookmarklet = {
init: function() {
this.parse();
},
parse: function() {
page = "";
$(".Profile_Collection:visible")
.children(".centered_content")
.children(".collection")
body{background:transparent;margin:0;}
#interactiveForm .fsForm .fsSubmit{
background:none;
padding:0;
margin:0;
display: inline-block;
}
#interactiveForm .fsEmbed .fsPage{
display:inline-block;
min-width:0 !important;
function addTranslations(){
var language = getParameter( "language");
if (language === null) {
language = "english";
}
var translations = {
english: {
"image": "english.png",
"label": "English",
"url": "#"
function share(){
var shareWindow;
var twitterBaseUrl = "http://twitter.com/share?text=";
var facebookBaseUrl = "https://www.facebook.com/dialog/feed?display=popup&app_id=741666719251986&link=";
var articleUrl = "http://gu.com/p/4df2n";
var urlsuffix = url.toString() ? "#p" + url : "";
var shareUrl = articleUrl;
var message = this.get('shareMessage')
var data;
var height = 600;
var width = 2000;
var blockWidth = 100;
d3.json('cleanresults.json',function(err,resp){
data = [resp[0]];
width = blockWidth*data[0].players.length;
doSomething();
});
{
"man city" : {
"fullname":"Manchester City",
"shortname":"man c",
"badge":"manchester-city.png"
},
"arsenal" : {
"fullname":"Arsenal",
"shortname":"ars",
"badge":"arsenal.png"
var request = require('request');
var cheerio = require('cheerio');
var fs = require('fs');
var liveblogUrl = "https://www.theguardian.com/politics/blog/live/2016/dec/02/liberal-democrats-celebrate-after-surprise-win-over-zac-goldsmith-in-brexit-byelection-live-reaction";
var headlines = [];
function getLiveBlogData(){
request(liveblogUrl, function (error, response, body) {
if (!error && response.statusCode == 200) {
var $ = cheerio.load(body);
& {
text-align: left;
border: none;
background: white;
display: block;
width: 100%;
height: 100%;
@media(min-width:820px){
// min-height: 80vh;
}
from bs4 import BeautifulSoup
import requests
import csv
country_codes = [
"global", "gb", "ar", "at", "au", "be", "bo", "br", "ca", "ch", "cl", "co", "cr", "cz", "de", "dk", "do", "ec", "es", "fi", "fr", "gr", "gt", "hk", "hn", "hu", "id", "ie", "is", "it", "jp", "lt", "lv", "mx", "my", "nl", "no", "nz", "pa", "pe", "ph", "pl", "pt", "py", "se", "sg", "sk", "sv", "th", "tr", "tw", "us", "uy"
]
dates = [
"2018-01-02", "2018-01-01", "2017-12-31", "2017-12-30", "2017-12-29", "2017-12-28", "2017-12-27", "2017-12-26", "2017-12-25", "2017-12-24", "2017-12-23", "2017-12-22",
@daanlouter
daanlouter / index.html
Last active February 19, 2021 13:18
Trying out Flourish scrollytelling feature
This is out of date, have a look at https://help.flourish.studio/article/21-controlling-stories-with-scrollytelling for more info