Skip to content

Instantly share code, notes, and snippets.

View sdavidsson90's full-sized avatar
🐧

Sighvatur Davidsson sdavidsson90

🐧
  • Aalborg University
  • Aalborg, Denmark
View GitHub Profile
# --
import subprocess
from datetime import datetime
time_start = datetime.now()
hostname = subprocess.run("printf `uname -n`", shell = True, capture_output=True, text=True).stdout
print(f"Running PyTorch benchmark on: {hostname}")
# --
@sdavidsson90
sdavidsson90 / gor.sh
Created October 26, 2025 18:24
Open remote url of the current git repo (gor = git open remote)
gor () {
is_git=$(git rev-parse --is-inside-work-tree 2>/dev/null)
if [[ $is_git != true ]]
then
echo "This is not a git repo"
return 1
fi
url="$(git remote get-url origin 2>/dev/null | sed -E 's#git@([^:]+):#https://\1/#')"
if [[ -z $url ]]
then