Skip to content

Instantly share code, notes, and snippets.

View oldmate45's full-sized avatar

Oldmate45 oldmate45

  • Aus
  • 12:59 (UTC +10:00)
View GitHub Profile
@joshooaj
joshooaj / ShowFileDialogs.ps1
Created August 4, 2023 20:13
Show the Windows open, save, and folder browser dialogs
Add-Type -AssemblyName System.Windows.Forms
Add-Type @'
using System;
using System.Runtime.InteropServices;
public class WindowHelper {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
@sebastiandg7
sebastiandg7 / ei.cfg
Last active October 28, 2025 19:50
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
[EditionID]
Professional
[Channel]
Retail
@ikedumancas
ikedumancas / utils.py
Created June 10, 2018 07:44
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: