Skip to content

Instantly share code, notes, and snippets.

View amnweb's full-sized avatar
🏠
Working from home

AmN amnweb

🏠
Working from home
View GitHub Profile
import win32gui
import win32api
import win32con
import time
import keyboard
def get_window_handle(window_title):
def callback(hwnd, extra):
if window_title in win32gui.GetWindowText(hwnd):
extra.append(hwnd)
@amnweb
amnweb / UndocumentedAcrylic.cs
Created September 1, 2024 18:32 — forked from xv/UndocumentedAcrylic.cs
Undocumented API for Windows 10 Acrylic style.
internal enum WindowCompositionAttribute
{
WCA_UNDEFINED = 0,
WCA_NCRENDERING_ENABLED = 1,
WCA_NCRENDERING_POLICY = 2,
WCA_TRANSITIONS_FORCEDISABLED = 3,
WCA_ALLOW_NCPAINT = 4,
WCA_CAPTION_BUTTON_BOUNDS = 5,
WCA_NONCLIENT_RTL_LAYOUT = 6,
WCA_FORCE_ICONIC_REPRESENTATION = 7,
@amnweb
amnweb / ollama-ai-powershell.ps1
Last active January 4, 2024 16:10
ollama ai powershell
function ChatInit {
param(
[Parameter(Mandatory = $true)][string]$Model
)
Write-Host "AI Chat Started`nModel: $Model" -ForegroundColor Blue
wsl -e ollama run $Model
}
function CreateMenu {
param(
@amnweb
amnweb / post WU installation cleanup script windows 11.bat
Created November 10, 2023 19:34
post WU installation cleanup script windows 11
:: Elevation script from StackOverflow
:: https://stackoverflow.com/a/28467343
:: Begin Elevation script
@ECHO OFF
setlocal EnableDelayedExpansion
::net file to test privileges, 1>NUL redirects output, 2>NUL redirects errors
@amnweb
amnweb / starship.toml
Created October 20, 2023 21:22
starship.toml
format = """
[](#3B4252)\
$username\
[](bg:#434C5E fg:#3B4252)\
$directory\
[](fg:#434C5E bg:#4C566A)\
$git_branch\
$git_status\
[](fg:#4C566A bg:#86BBD8)\
$c\
@amnweb
amnweb / Clear_Event_Viewer_Logs.bat
Created September 24, 2023 17:32
Clear Event Viewer Logs Windows 10/11
@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo All Event Logs have been cleared.
goto theEnd
:do_clear
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#45F1C2",
"style": "plain",
"template": "{{if .Root}}root{{else}}{{ .UserName }}{{end}}",