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
Last active March 19, 2026 17:28
Open remote url of the current git repo (gor = git open remote)
gor() {
# ----------------------------------------------
# gor: git open remote
# Open the current repository at it's remote URL
# ----------------------------------------------
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || { echo "No a git repo!"; return 1; }
url="$(git remote get-url origin 2>/dev/null | sed -E 's#git@([^:]+):#https://\1/#')"
[[ -z "$url" ]] &&