Skip to content

Instantly share code, notes, and snippets.

View benmatselby's full-sized avatar

Ben Selby benmatselby

View GitHub Profile
@benmatselby
benmatselby / pre-commit
Last active November 12, 2022 14:53
Example pre-commit hook
#!/usr/bin/env bash
#
# Git pre-commit hook
#
# Colours https://misc.flogisoft.com/bash/tip_colors_and_formatting
reset=$'\e[0m'
red=$'\e[1;31m'
@benmatselby
benmatselby / location.py
Created April 12, 2024 19:51
Geolocation investigation
# Script to get locations based on lat/long or IP address
#
# Installation:
# pip install geopy
# pip install ip2geotools
from geopy.geocoders import Nominatim
from ip2geotools.databases.noncommercial import DbIpCity
# ------------------------------