Skip to content

Instantly share code, notes, and snippets.

View csandman's full-sized avatar

Chris Sandvik csandman

View GitHub Profile
@csandman
csandman / GoogleMap.js
Last active May 28, 2019 16:20
A bare-bones React component for using the Google Maps API
// takes props:
// apiKey: string
// mapOptions: object
// mapID: string
// onMapLoad: function(mapOject)
// mapLibraries: array[string]
// Function Version
@csandman
csandman / download-file.js
Created May 20, 2019 20:27
JS Download Function
function download(filename, filepath) {
let element = document.createElement('a');
element.setAttribute('href', filepath);
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}