Skip to content

Instantly share code, notes, and snippets.

View legendof-selda's full-sized avatar

Stalin Sabu Thomas legendof-selda

View GitHub Profile
@legendof-selda
legendof-selda / steam_shutdown.ps1
Created July 22, 2025 20:07
Steam auto shutdown after downloads
<#
.SYNOPSIS
Tracks Steam download activity and schedules a computer shutdown when downloads finish.
.DESCRIPTION
This script polls the Steam client’s registry and app manifest files to determine download status.
It handles scenarios like network interruptions and manual cancellation by checking the presence
and content of the appmanifest_<ID>.acf files. After observing a configurable number of idle
cycles following a completed download, it triggers a system shutdown with a grace period to abort.
@legendof-selda
legendof-selda / mkdocs_azure_wiki_sync.yml
Last active December 9, 2024 17:28
GitHub action which syncs mkdocs to azure devops wiki.
name: Publish docs via GitHub Pages
# syncs your mkdocs markdown files with azure devops wiki.
# NOTE: this doesn't work with automated markdown files which maybe generated in your case
# this also doesn't deal with ordering
on:
push:
branches:
- develop
workflow_dispatch:
@legendof-selda
legendof-selda / pyproject.toml
Last active July 3, 2024 07:14
Default pyproject.toml file
# Replace 'src' with the right package name.
# Change project.name
# Ensure author name and email matches.
# Change project.urls.Home
# Update python version.
# update packages.
[build-system]
requires = ["poetry-core", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
@legendof-selda
legendof-selda / _version.py
Last active August 17, 2021 14:30
A quick version tagging script which uses git. Simply in cli run python _version.py {the method name}
import os
import subprocess
import sys
from typing import Union
BRANCH_TAG_MAP = {
"develop": "nightly",
"staging": "alpha",
"release": "alpha",
"master": None,
@legendof-selda
legendof-selda / stale_branch_cleanup.py
Last active July 27, 2021 09:49
A python script to cleanup stale or old branches in git using last commit date and required flag
import pandas as pd
import subprocess
import os
env = os.environ.copy()
STALE_PERIOD = 10
REQUIRED_BRANCHES = ['master', 'staging', 'develop']
branches = subprocess.run('git branch -r' , capture_output=True, env=env, shell=True)
branches = branches.stdout.decode('utf-8').strip().split('\n')[1:]