Skip to content

Instantly share code, notes, and snippets.

@ThioJoe
ThioJoe / Get_All_Shell_Folder_Shortcuts.ps1
Last active October 11, 2024 18:05
Fetches all shell folders from Windows Registry and creates a shortcut to each, while attempting to determine the proper name and icon. Also outputs CSV file with results.
# NOTE - THIS SCRIPT IS NOW OBSOLETE - SEE MY OTHER REPO FOR A MUCH MORE COMPREHENSIVE TOOL: https://github.com/ThioJoe/Windows-Super-God-Mode
# Get All Shell Folder Shortcuts Script (Updated 8/10/2024)
# Original source: https://gist.github.com/ThioJoe/16eac0ea7d586c4edba41b454b58b225
# This PowerShell script is designed to find and create shortcuts for all special shell folders in Windows.
# These folders can be identified through their unique Class Identifiers (CLSIDs) or by their names.
# The script also generates CSV files listing these folders and associated tasks/links.
# How to Use:
# 1. Open PowerShell and navigate to the path containing this script using the 'cd' command.
@ThioJoe
ThioJoe / DisableUSBPowerManagement.ps1
Last active October 27, 2024 11:14
PowerShell script to disable Windows power management on all currently connected serial ports, including most (if not all) USB devices and adapters.
# PowerShell script to disable Windows power management on all currently connected serial ports, including USB adapters
# In simpler terms, it prevents Windows from turning off connected serial devices to save power.
# Equivalent to right-clicking on a serial port device in Device Manager > Properties > "Power Management" Tab > Unchecking "Allow the computer to turn off this device to save power."
$hubs = Get-CimInstance -ClassName Win32_SerialPort | Select-Object Name, DeviceID, Description
$powerMgmt = Get-CimInstance -ClassName MSPower_DeviceEnable -Namespace root\wmi
foreach ($p in $powerMgmt) {
$IN = $p.InstanceName.ToUpper()
foreach ($h in $hubs) {
@neverUsedGithub
neverUsedGithub / graphql-parser.d.ts
Created July 25, 2023 06:38
A type-level graphql lexer & parser & ts converter.
// Utility
type GetFirstCharacter<Text extends string> = Text extends `${infer First}${infer Rest}` ? First : never;
type StringStartsWith<Source extends string, Char extends string> = Source extends `${infer First}${infer Rest}`
? First extends Char
? true
: false
: false;
type SliceStringFirst<Source extends string> = Source extends `${infer First}${infer Rest}`
? Rest
: never;
@jaames
jaames / mii-qr.py
Created July 24, 2018 21:02
Decrypt Mii QR code data from 3DS / Wii U / Miitomo
# Decrypt Mii QR codes from 3DS / Wii U / Miitomo
# Usage: python3 <input file> <output file>
# QR docs: https://www.3dbrew.org/wiki/Mii_Maker
from Crypto.Cipher import AES
from sys import argv
key = bytes([0x59, 0xFC, 0x81, 0x7E, 0x64, 0x46, 0xEA, 0x61, 0x90, 0x34, 0x7B, 0x20, 0xE9, 0xBD, 0xCE, 0x52])
with open(argv[1], "rb") as infile, open(argv[2], "wb") as outfile: