Skip to content

Instantly share code, notes, and snippets.

View atillay's full-sized avatar

Alexandre Tillay atillay

View GitHub Profile
@atillay
atillay / parseGoogleMapsAddressComponents.js
Last active April 20, 2018 15:45
Google Maps API address components parser
/**
* parseGoogleMapsAddressComponents
*
* Converts the addressComponents sent by GoogleMaps into a clean object
* The precision value allows to know what is the precision level of the address (one point per component)
* Ex: If the street number is available, then the precision value would be 6.
*
* @param addressComponents
* @returns object
*/
@atillay
atillay / post-commit.sh
Last active April 6, 2018 14:25
Git post-commit hook to save daily activity into a file
#!/bin/sh
# Setup : https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook
today=$(date +%d-%m-%Y)
log_file_name=”git-commits-$today.txt”
log_dir=”$HOME/Desktop”
log_file_path=”$log_dir/$log_file_name”
remote=$(git config — get remote.origin.url)