Skip to content

Instantly share code, notes, and snippets.

@petehamilton
petehamilton / plot-data.r
Last active February 8, 2018 17:43
Plot GoCardless Customers by Location
# Execute with: R --slave -f draw.r
library(maps)
library(mapdata)
library(foreach)
library(doParallel)
# Use the GoCardless font
par(family="Gotham-Book")
(() => {
const groups = [].slice.apply(document.querySelectorAll('.issueContainer'))
.map((node) => {
return {
link: node.querySelector('.issue-info a').getAttribute('href'),
id: node. querySelector('.issueId').textContent.trim(),
title: node.querySelector('.issue-summary').textContent.trim(),
priority: node.querySelector('[title^="Priority: "]').textContent.trim(),
type: node.querySelector('[title^="Type: "]').textContent.trim(),
};
@petehamilton
petehamilton / postfacto.js
Last active June 2, 2017 16:28
Postfacto -> Paper
// Copy the below into the browser's console on a Postfacto archive screen
(() => {
let components = [
`## Postfacto archive: ${window.location}`,
];
components = components.concat(
[
{ title: 'It wasn\'t so great that...', points: $$('.column-sad .item-text').map((el) => el.innerText) },
/*
* We don't want to log each fetching of a value from a sequence,
* so we pre-log a few fetches in advance. In the event of
* crash we can lose (skip over) as many values as we pre-logged.
*/
#define SEQ_LOG_VALS 32