Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile

winget install -e --id Git.Git

winget install -e --id=Python.Python.3.13

winget install -e --id Microsoft.VisualStudioCode

winget install -e --id Microsoft.PowerShell

# Get all files in the current directory, excluding the output file
Get-ChildItem -File | Where-Object {$_.Name -ne "file_contents.txt"} | ForEach-Object {
# Print the filename
"Filename: $($_.Name)"
# Print the file contents
"Contents:"
Get-Content -Path $_.FullName
"------------------------"
} | Out-File -FilePath "file_contents.txt" -Encoding utf8

Excel Data Cleanup with cyberchef

CHEF Format

Find_/_Replace({'option':'Simple string','string':'""'},'"',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'"CASE'},'CASE',true,false,true,false)
Find_/_Replace({'option':'Simple string','string':'}"'},'}',true,false,true,false)

Recipie Demo

// https://ringcentral.github.io/ringcentral-embeddable/
function dialNumber(number) {
const buttonSelector = "#viewport > div > div > div.sc-eIcdZJ.czoGgN > div.sc-BQMaI.bHaYic > div.sc-epqpcT.cBEqvY > div > div.sc-gvPdwL.lcuqyY > div.sc-ggqIjW.gfQTjQ > div > button:nth-child({index})";
const digits = number.toString().split('');
const delay = 500; // 50ms delay between each press
digits.forEach((digit, index) => {
setTimeout(() => {
@mark05e
mark05e / determine if Im in powershell or cmd.md
Created September 4, 2024 11:26
Determine if I'm in powershell or cmd
(dir 2>&1 *`|echo CMD);&<# rem #>echo PowerShell
(dir 2>&1 *`|echo CMD);&<# rem #>echo ($PSVersionTable).PSEdition

Reference:

Postman Scripts

Write OAuth to environment variables

// Write OAuth to environment variables
if (pm.response.code == 200) {
    const responseJson = pm.response.json();

    const access_token = responseJson.access_token;
    pm.environment.set("__access_token", access_token)
@mark05e
mark05e / xmlnotepad-comment.ahk
Last active June 17, 2024 19:12
XML Notepad - Performs keyboard shortcuts to comment and uncomment nodes
; Author: mark05e, Gemini/Bard (Large Language Model by Google)
; Description: Performs keyboard shortcuts to comment and uncomment nodes within XML Notepad.
; - Ctrl + / or Ctrl + K: Simulates menu key press followed by "h" and "o" keys (for commenting)
; - Ctrl + Shift + / or Ctrl + Shift + K: Simulates menu key press followed by "h" and "e" keys (for uncommenting)
; References:
; - https://www.reddit.com/r/AutoHotkey/comments/xrfk3c/mouse_right_click_and_select_an_action_from/
; - https://github.com/microsoft/XmlNotepad/issues/396
; - https://www.autohotkey.com/boards/viewtopic.php?t=38761
; Hotkeys:
; - Ctrl + /