Skip to content

Instantly share code, notes, and snippets.

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

James P. Verde JustSuperHuman

🏠
Working from home
View GitHub Profile
^+g:: ; CTRL+SHIFT+G hotkey
{
ChatGPTWinTitle := "ChatGPT"
; Check if a window with the title "ChatGPT" exists
if WinExist(ChatGPTWinTitle)
{
; If it exists, bring it to the foreground and activate it
WinActivate
}
@JustSuperHuman
JustSuperHuman / split-openapi-docs.js
Created November 3, 2024 19:08
Split a large OpenAPI specification into separate smaller docs by tag!
const fs = require("fs");
const path = require("path");
// Utility to deep clone objects
const deepClone = (obj) => JSON.parse(JSON.stringify(obj));
// Load the OpenAPI document
const loadOpenApiSpec = (filePath) => {
try {
return JSON.parse(fs.readFileSync(filePath, "utf8"));
# Directory Tree Generator
param(
[Parameter(Mandatory=$false)]
[string]$RootPath = (Get-Location),
[Parameter(Mandatory=$false)]
[string]$OutputFile = "api-tree.list"
)
# Default ignore patterns
$defaultIgnorePatterns = @(
@JustSuperHuman
JustSuperHuman / OpenWithCursor.ps1
Last active September 6, 2024 03:40
Add "Open With Cursor" to the Windows Context menu
# Check if running with administrator privileges
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
# Relaunch the script with admin rights
Start-Process powershell.exe -Verb RunAs -ArgumentList ("-File", $MyInvocation.MyCommand.Path)
exit
}
# Define the Cursor executable path