$ docker
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
| // let array = [1,2,3,4,5] | |
| // console.log('array: ', array); | |
| // array.push(7) | |
| // console.log('array: ', array); | |
| // array.pop() | |
| // console.log('array: ', array); | |
| // array.shift() | |
| // console.log('array: ', array); | |
| // array.unshift(0) | |
| // console.log('array: ', array); |
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
| let bubbleSort = [2, 9, 6, 1, 5, 3] | |
| const bubbleSortFun = (arr) => { | |
| var length = arr.length; | |
| for (var i = 0; i < length; i++) { | |
| for (var j = 0; j < (length - i - 1); j++) { | |
| //Compare the adjacent positions | |
| if (arr[j] > arr[j + 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
| def get_postcode(address): | |
| pattern = r'[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}' | |
| match = re.search(pattern, address) | |
| if match is None: | |
| return None | |
| else: | |
| postcode = match.group(0) | |
| return postcode | |
| def get_lat_lng_from_postcodeio( postcode ): |
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
| # Using Python requests and the Google Maps Geocoding API. | |
| # | |
| # References: | |
| # | |
| # * http://docs.python-requests.org/en/latest/ | |
| # * https://developers.google.com/maps/ | |
| import requests | |
| GOOGLE_MAPS_API_URL = 'http://maps.googleapis.com/maps/api/geocode/json' |