Skip to content

Instantly share code, notes, and snippets.

View abduljamac's full-sized avatar
😁

Abdul Jamac abduljamac

😁
View GitHub Profile
@abduljamac
abduljamac / docker-help.md
Created June 13, 2020 23:47 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

// 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);
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]) {
@abduljamac
abduljamac / latlng.py
Created September 27, 2018 15:38
Get Lat and Lng from postcode
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 ):
@abduljamac
abduljamac / geocode.py
Created July 12, 2018 14:16 — forked from pnavarrc/geocode.py
Using Python requests and the Google Maps Geocoding API
# 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'