Skip to content

Instantly share code, notes, and snippets.

View simonwhatley's full-sized avatar

Simon Whatley simonwhatley

View GitHub Profile
@simonwhatley
simonwhatley / FEATURE_CHANGE.md
Created January 8, 2019 09:52
Pull Request Template – Requirements for adding, changing or removing a feature

Requirements for adding, changing or removing a feature

  • Fill out the template below. Maintainers are free to close any pull requests that do not include enough information, at their discretion.
  • The pull request must contribute a change that has been endorsed by the maintainer team. See details in the template below.
  • The pull request must update the test suite to exercise the updated functionality.
  • After you create the pull request, all status checks must pass before a maintainer reviews your contribution.

Issue or RFC endorsed by the repository's maintainers

@simonwhatley
simonwhatley / DOCUMENTATION.md
Created January 8, 2019 09:48
Pull Request Template – Requirements for contributing to documentation

Requirements for contributing to documentation

Description of the Change

@simonwhatley
simonwhatley / BUG_FIX.md
Created January 8, 2019 09:47
Pull Request Template – Requirements for contributing a bug fix

Requirements for contributing a bug fix

Identify the bug

@simonwhatley
simonwhatley / FEATURE_REQUEST.md
Created January 8, 2019 09:44
Issue Template – Requesting a feature change
name about
Feature request
Suggest an idea for this project
@simonwhatley
simonwhatley / BUG_REPORT.md
Created January 8, 2019 09:42
Issue Template – Reporting a bug
name about
Bug report
Report a bug to help us improve the project
@simonwhatley
simonwhatley / CONTRIBUTING.md
Created January 8, 2019 09:38
Contributing to the repository

Contribution guidelines

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Contributing

If you’ve got an idea or suggestion you can:

@simonwhatley
simonwhatley / index.js
Last active December 2, 2018 21:46
Uploading files to AWS S3 using NodeJS
const AWS = require('aws-sdk');
const fs = require('fs');
const path = require('path');
//configuring the AWS environment
AWS.config.update({
accessKeyId: "AWS_ACCESS_KEY",
secretAccessKey: "AWS_SECRET_ACCESS_KEY"
});
@simonwhatley
simonwhatley / example.md
Last active June 29, 2018 11:06
How to use the Marked NPM package (https://www.npmjs.com/package/marked) in the GOV.UK prototype kit based on @joelanman's gist https://gist.github.com/joelanman/263cbe51c6a33712f1ebfa697fa36d13

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras metus turpis, sodales a lacus et, venenatis ullamcorper elit. Nunc cursus pellentesque leo. Nulla viverra sapien ac tortor feugiat finibus.

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras metus turpis, sodales a lacus et, venenatis ullamcorper elit. Nunc cursus pellentesque leo. Nulla viverra sapien ac tortor feugiat finibus.

Nullam vestibulum risus non odio sollicitudin cursus. Maecenas ultrices neque massa, nec ullamcorper elit hendrerit nec. Duis quis nibh ultrices libero bibendum mollis eu et nunc. Sed tincidunt eu nisl in ornare.

@simonwhatley
simonwhatley / generateUUID.js
Created May 11, 2018 21:43
JavaScript UUID Generator
function generateUUID() {
var d = new Date().getTime();
if(Date.now) {
d = Date.now(); //high-precision timer
}
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
@simonwhatley
simonwhatley / GoogleDistance.gs
Last active October 3, 2024 17:11
Get the distance between 2 addresses in Google Sheets using Google Maps
/**
* Get the distance between 2 different addresses.
* @param {string} origin_address The origin/start address as string Eg. "102 Petty France, London, SW1H 9AJ".
* @param {string} destination_address The destination/end address as string Eg. "10 Whitechapel High Street, London, E1 8QS".
* @param {string} travel_mode The mode of travel as string. Default: DRIVING. Options: BICYCLING, TRANSIT, WALKING.
* @param {string} return_type The return type as string. Default: MILES. Options: KILOMETERS, MINUTES, HOURS, STEPS.
* @return the distance between 2 different addresses.
* @customfunction
*/
function GOOGLEDISTANCE(origin_address,destination_address,travel_mode,return_type) {