Skip to content

Instantly share code, notes, and snippets.

View radiocontrolled's full-sized avatar

Alison Benjamin radiocontrolled

  • London
View GitHub Profile
@radiocontrolled
radiocontrolled / README.md
Last active March 1, 2023 14:18
Humanitarian population by major Canadian city, 2012
const lighthouse = require('lighthouse');
const chromeLauncher = require('chrome-launcher');
// run this with
// node lighthouseTest.js --accessibility=0.79 --seo=2
// it will fail on SEO
const args = process.argv.slice(2);
@radiocontrolled
radiocontrolled / readme.md
Created July 12, 2019 11:55
GitHub in 5 minutes

Clone a repository
Cloning refers to making a copy of a repository (e.g. https://github.com/bbc/vjdata.24555.cqcfsa) to your local machine - so you can have access to the code on your own pc.
git clone git@github.com:bbc/vjdata.24555.cqcfsa.git

Initiate a repository from scratch
Requires an existing folder whose changes you want to track (called the 'working directory') This command will create a .git folder inside the directory, which is responsible tracking the changes your are making.

  • cd into the directory
  • git init

On branch (e.g. master), do

git checkout -b my_branch_name # create a new branch
git status # check that your're on new branch, and if there's anything to commit
git add . # add everything, or alternatively, add one by one
git commit -m 'my commit message"
git push # at this point... git will respond by saying did you mean "git push --set-upstream origin my_branch_name", so follow that command to complete pushing your local branch
@radiocontrolled
radiocontrolled / scenario-02.html
Created July 31, 2018 13:05
bbc-a11y 'Text styled with px unit' error
<!doctype html>
<html lang="en-GB">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="nofollow" />
<link rel="manifest" href="manifest.json" />
<link rel="preconnect" href="https://ichef.bbci.co.uk" crossOrigin="anonymous" />
@radiocontrolled
radiocontrolled / Africa.json
Last active January 30, 2017 02:14
What per cent of people per African country use the Internet?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radiocontrolled
radiocontrolled / README.md
Last active January 30, 2017 02:08
Responsive map

Experimenting with re-drawing a map using a resize() function.

@radiocontrolled
radiocontrolled / boroughPrices.csv
Last active January 30, 2017 02:07
Average private rents, London 2012 and 2013
borough twentytwelve twentythirteen
City of London 1960 1767
Barking and Dagenham 866 921
Barnet 1390 1460
Bexley 872 880
Brent 1372 1276
Bromley 1045 1027
Camden 1903 1987
Croydon 884 926
Ealing 1178 1369
function isAutoplay() {
var url = window.location.search;
var arr = url.split(/(\&|\?)/);
var autoplay = false;
for(var i = 0; i < arr.length; i++) {
if(arr[i] === "autoplay=true") {
autoplay = true;
}
@radiocontrolled
radiocontrolled / d3.v3.js
Last active January 9, 2016 15:23
Interactive thermometer, version 2
d3 = function() {
var d3 = {
version: "3.3.5"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};