Skip to content

Instantly share code, notes, and snippets.

// 1. Select all elements that match the selector
const pdfButtons = document.querySelectorAll('button.buttonLink.ng-star-inserted:not([disabled])');
// 2. Loop through the elements and schedule the click with a delay
pdfButtons.forEach((button, index) => {
function performActions() {
const rows = document.querySelectorAll('.uf-table-row-clickable');
const downloadDelay = 2300; // Delay in milliseconds before clicking the download button
const mouseEvent = (element) => {
if (element) {
element.dispatchEvent(new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
// This script automates clicking a checkbox and a download button,
// using a click event to uncheck the previous checkbox.
const checkboxes = document.querySelectorAll('.td-wb-checkbox__input');
const downloadButton = document.getElementById('td-wb-eservices-statements-download');
// Base delay of 500ms + a random variation
const baseDelay = 500;
let i = 0;
const preElement = document.querySelector('pre');
const jsonString = preElement.textContent;
const data = JSON.parse(jsonString);
const uniquePlanNames = [...new Set(Object.values(data).map((value) => value.plan_name))];
@LikeCarter
LikeCarter / ignore_build_step.sh
Created August 26, 2025 19:38
Vercel's provided "ignore build step" command is incorrect. This command will build when changes are detected in .ts or .tsx files.
git diff HEAD^ HEAD --name-only | grep -E '.*\.(ts|tsx)$' | wc -l | xargs -I {} test {} -eq 0 && echo "Nothing found..." || exit 1"
$interfaceName = "Wi-Fi"
# Check if the interface is up and connected
$interface = Get-NetAdapter -Name $interfaceName -Physical | Where-Object { $_.Status -eq "Up" }
if ($interface) {
# Check for internet connectivity using Test-NetConnection
$test = Test-NetConnection -ComputerName 8.8.8.8 -InformationLevel Quiet
if (-not $test) {
@LikeCarter
LikeCarter / Reset-DNS-If-No-Internet.ps1
Last active June 2, 2025 15:36
Reset-DNS-If-No-Internet.ps1
<#
.SYNOPSIS
Resets DNS server addresses to automatic (DHCP) for all active network adapters using a UAC prompt for elevation.
.DESCRIPTION
This script identifies all active network adapters and then attempts to reset their DNS server
addresses to be obtained automatically via DHCP. If the script is not run with administrative
privileges, it will automatically prompt for elevation using a UAC dialog.
This eliminates the need to hardcode or explicitly prompt for administrator credentials within the script.
The new PowerShell window launched by 'runas' will remain open after execution, even if errors occur,
# Define URLs
$prepToolUrl = "https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool/raw/refs/heads/master/IntuneWinAppUtil.exe"
$acrobatMspUrl = "https://ardownload2.adobe.com/pub/adobe/acrobat/win/Acrobat2020/2000530748/Acrobat2020Upd2000530748.msp"
# Define output paths
$toolPath = "$env:TEMP\IntuneWinAppUtil.exe"
$appPath = "$env:TEMP\Win32AppPackageBuilder"
$acrobatMspPath = "$appPath\Acrobat2020Upd.msp"
$outputFolder = "$env:TEMP\Win32AppPackage"
@LikeCarter
LikeCarter / AI Rename.scpt
Last active February 23, 2025 02:12
DevonThink AI Rename
-- Rename Files Using OpenAI API with Verbose Logging and Progress Indicator
-- Based on (c) 1201 Apple, Inc. & (c) 1204-2019 DEVONtechnologies, LLC.
tell application id "DNtp"
try
set this_selection to the selection
if this_selection is {} then error "Please select some contents."
set itemCount to count of this_selection
set currentIndex to 0
# Fixing Stripped Exchange Online Role Permissions: A Step-by-Step Solution
When managing Exchange Online roles, it's easy to accidentally strip critical permissions while making modifications. Here's how I recently solved an issue where the Organization Management role lost most of its permissions, including the crucial Role Management permission.
## The Problem
During a routine task of adding Import PST permissions to the Organization Management role, most other permissions were inadvertently removed. The situation was particularly challenging because:
1. The Role Management permission was among those stripped
2. The 365 Admin Center's people picker wasn't functioning