Skip to content

Instantly share code, notes, and snippets.

@TheoLeanse
TheoLeanse / README.md
Last active August 29, 2015 14:11
Enrolment

A revamp of Tufte's least favourite chart ever. Ends up much less exciting, but a little more accurate imo. Produced for the Udacity course "Data Visualisation and D3.js".

@TheoLeanse
TheoLeanse / README.md
Last active August 29, 2015 14:12
Interactive Small Multiple Choropleth Maps

Mapping the global distribution of the world's most powerful supercomputers, 2005-14. Figures are in Rmax, the maximal LINPACK performance achieved, as used by Top500 to rank supercomputing power.

Data from www.top500.org

Please feel free to use your cursor to explore the numbers behind the map more closely.

Instagram Feed Clone

  • two linked pages - for example, profile and about / home page
  • an external stylesheet
  • create a github profile and upload the work for review (we will add a tutorial) [possibility to put on github pages]

goals

  • two html files, external css, github
  • research and using docs
@TheoLeanse
TheoLeanse / news-sitemap-check.js
Created October 10, 2016 08:49
Sitemaps Healthcheck
const denodeify = require('denodeify');
const xml2js = denodeify(require('xml2js').parseString);
require('isomorphic-fetch');
const twoDaysAgo = new Date();
twoDaysAgo.setUTCDate(twoDaysAgo.getUTCDate() - 2);
fetch('https://www.ft.com/sitemaps/news.xml', {
headers: {
'Cookie': 'FT_SITE=DUBNEXT'
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r79/three.min.js"></script>
<script>
let container;
index=cdn_prod sourcetype=fastly serviceid=133g5BGAc00Hv4v8t0dMry status=5** ft_site=dubnext | timechart count by url limit=100
const SELECTORS = {
rubadub: {
url: 'http://www.rubadub.co.uk/records'
selectors: ['.product-name']
},
boomkat: {
url: 'https://boomkat.com'
selectors: ['.release__details']
}
}
const values = [ 50, 500, 5000, 50000 ].sort((a, b) => a - b);
const min = values[0];
const max = values[values.length - 1];
const range = max - min;
const getScore = value => (value - min) / range;
// in haikro/lib/build/minimumNpmVersion, add:
version = version.replace(/\(node\:[0-9]+\) fs\: re-evaluating native module sources is not supported\. If you are using the graceful\-fs module\, please update it to a more recent version\.\n/g, '');
<section class="large">
<h3>Headline</h3>
<p class="subtitle">This is some subtitle</p>
<img class="n-image" alt="" role="presentation" srcset="https://www.ft.com/__origami/service/image/v2/images/raw/http%3A%2F%2Fcom.ft.imagepublish.prod.s3.amazonaws.com%2F2e46682c-49bb-11e6-8d68-72e9211e86ab?source=next&amp;fit=scale-down&amp;width=600 600w, https://www.ft.com/__origami/service/image/v2/images/raw/http%3A%2F%2Fcom.ft.imagepublish.prod.s3.amazonaws.com%2F2e46682c-49bb-11e6-8d68-72e9211e86ab?source=next&amp;fit=scale-down&amp;width=315 315w" sizes="(min-width: 46.25em) 600px, calc(100vw - 20px)">
<p class="section-body">
<em>This is the main body text.</em><br><a href="/content/db1b6304-492a-11e6-b387-64ab0a67014c" data-trackable="link">It can contain links</a>and pretty much anything else you could have in a normal body.<br/><br/>
That includes line breaks, <strong>bold</strong> and who know's what else. The world is your oyster.
</p>
</section>