Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Example Usage of custom control | |
export default ({lat, lng, google}) => ( | |
<GoogleMap | |
defaultCenter={{lat, lng}} | |
defaultZoom={14} | |
minZoom={6} | |
google={google} | |
containerStyle={{ height: '575px', width: '100%', position: 'relative' }} | |
> | |
<Marker position={{lat, lng}} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lastNotNull = (arr) => arr[arr.length - 1] ? arr[arr.length - 1] : lastNotNull(arr.slice(0, -1)) | |
const values = [1, 3, 5, 2, null, null] | |
console.log(lastNotNull(values)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unique(arr, func) { | |
const uniques = arr.reduce((o, k) => func(k) in o ? o : Object.assign(o, {[func(k)]: k}), {}) | |
return Object.keys(uniques).map(k => uniques[k]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numbers = [ 1, 2, 3, 5, 7, 22, 34, 56, 234] | |
const average = numbers.reduce(runningAverage) | |
function runningAverage (average, current, idx) { | |
return (average * idx + current) / (idx + 1) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapValues = function mapValues(obj, map) { | |
return Object.keys(obj).reduce(function (o, k) { | |
return Object.assign(o, _defineProperty({}, k, map(obj[k]))); | |
}, {}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> | |
Audio | |
</title> | |
</head> | |
<body> | |
<audio id="myAudio" autoplay preload="auto" class="audio--source"> |