Skip to content

Instantly share code, notes, and snippets.

View dockleryxk's full-sized avatar

Richard Jeffords dockleryxk

View GitHub Profile
@bomberstudios
bomberstudios / convertIdToClass.js
Created October 10, 2018 10:17
SVGO plugin to convert the `id` attribute of an element to a `class` attribute with the same value.
// This SVGO plugin converts the `id` attribute on an element into a `class` attribute with the same value.
// To use it, you'll need to disable the `cleanupIDs` plugin, otherwise you won't have any `id` attribute to replace :)
'use strict';
exports.type = 'perItem';
exports.active = true;
exports.description = 'convert id attribute to class, using the same value';
@xola139
xola139 / Invalid Host Header NGROK
Created February 19, 2018 19:17
When Invalid Host Header when ngrok tries to connect to Angular or React dev server
When Invalid Host Header when ngrok tries to connect to Angular or React dev server use this form for run ngrok.
ngrok http 8080 -host-header="localhost:8080"
ngrok http --host-header=rewrite 8080
@levymetal
levymetal / directions.js
Last active November 1, 2022 02:38
Tutorial on how to calculate driving distance using Google maps API, full post available @ http://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/
var directionsService = new google.maps.DirectionsService();
var request = {
origin : 'Melbourne VIC', // a city, full address, landmark etc
destination : 'Sydney NSW',
travelMode : google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if ( status == google.maps.DirectionsStatus.OK ) {