Skip to content

Instantly share code, notes, and snippets.

@troys-code
Last active September 23, 2025 15:17
Show Gist options
  • Select an option

  • Save troys-code/49533f04540515851de34818c9e38521 to your computer and use it in GitHub Desktop.

Select an option

Save troys-code/49533f04540515851de34818c9e38521 to your computer and use it in GitHub Desktop.
import os
import subprocess
import mimetypes
from datetime import datetime
def _create():
return None # Placeholder function, maintaining original intent
def get_mime_type(path):
"""Return the MIME type suffix (e.g., 'html' from 'text/html') or None if unknown."""
mime_type, _ = mimetypes.guess_type(path)
return mime_type.split('/')[-1] if mime_type else None
def get_timestamp():
"""Return current timestamp as ISO 8601 string."""
return datetime.now().isoformat()
def run(cmd):
"""Execute shell command and return output as string."""
return subprocess.check_output(cmd, shell=True, text=True).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment