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
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
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 / 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" />
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;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TicTacToe</title>
</head>
<body>
Open your console to play.
<script src="script.js"></script>
@radiocontrolled
radiocontrolled / d3.min.js
Last active August 29, 2015 14:12
The Solar System sorted
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null===n?0/0:+n}function e(n){return!isNaN(n)}function r(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function u(n){return n.length}function i(n){for(var t=1;n*t%1;)t*=10;return t}function o(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function a(){this._=Object.create(null)}function c(n){return(n+="")===la||n[0]===sa?sa+n:n}function l(n){return(n+="")[0]===sa?n.slice(1):n}function s(n){return c(n)in this._}function f(n){return(n=c(n))in this._&&delete this._[n]}function h(){var n=[];for(var t in this._)n.push(l(t));return n}function g(){var n=0;for(var t in this._)++n;return n}function p(){for(var n in this._)return!1;return!0}function v(){this._=Object
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radiocontrolled
radiocontrolled / countries.json
Last active August 29, 2015 14:07
Responsive Globe
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@radiocontrolled
radiocontrolled / d3.min.js
Last active August 29, 2015 14:05
Film leader
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ha+n in this}function c(n){return n=ha+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===ga&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===ga)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,