Skip to content

Instantly share code, notes, and snippets.

View oldmate45's full-sized avatar

Oldmate45 oldmate45

  • Aus
  • 07:49 (UTC +10:00)
View GitHub Profile
@oldmate45
oldmate45 / utils.py
Created August 25, 2025 01:57 — forked from ikedumancas/utils.py
Python: Convert timedelta to HHMMSS string
def format_timedelta_to_HHMMSS(td):
td_in_seconds = td.total_seconds()
hours, remainder = divmod(td_in_seconds, 3600)
minutes, seconds = divmod(remainder, 60)
hours = int(hours)
minutes = int(minutes)
seconds = int(seconds)
if minutes < 10:
minutes = "0{}".format(minutes)
if seconds < 10:
@oldmate45
oldmate45 / test.html
Created July 24, 2025 19:47
Hello World Html.
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@oldmate45
oldmate45 / test.md
Created July 24, 2025 19:46
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@oldmate45
oldmate45 / ei.cfg
Created January 11, 2025 13:54 — forked from sebastiandg7/ei.cfg
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
[EditionID]
Professional
[Channel]
Retail
@oldmate45
oldmate45 / Restore-Ownership.ps1
Created November 22, 2023 04:30 — forked from joshooaj/Restore-Ownership.ps1
Take ownership of files/folders and restore permissions
function Restore-Ownership {
<#
.SYNOPSIS
Restores file/folder ownership for the current user or the Administrators group.
.DESCRIPTION
The `Restore-Ownership` cmdlet restores ownership of files and/or folders
for the current Windows user (default), or the BUILTIN\Administrators group.
This is accomplished using `takeown.exe` to take ownership of the file or
folder, followed by `Set-Acl` to add a `System.Security.AccessControl.FileSystemAccessRule`