Skip to content

Instantly share code, notes, and snippets.

View HaydenElza's full-sized avatar

Hayden Elza HaydenElza

View GitHub Profile
@HaydenElza
HaydenElza / agol_transfer_ownership.py
Last active March 6, 2024 05:26
Given an app item ID, transfer ownership of the app and all associated items in ArcGIS Online.
"""Transfer Ownership of App and Associated Web Maps and Feature Layers.
Given an app item ID, transfer ownership of the app and all associated items.
"""
from arcgis.gis import *
# Parameters
@HaydenElza
HaydenElza / Allow Paste.md
Created April 5, 2024 20:35
Re-enable paste in form input when disabled by website.

Allow Paste

Re-enable paste in form input when disabled by website.

var allowPaste = function(e) {
  e.stopImmediatePropagation();
  console.log("Free the paste!")
  return true;
};
@HaydenElza
HaydenElza / Copy First Level Folders Only.ps
Created January 15, 2025 21:20
Power shell script to copy only the first level folders of a directory, no files or subfolders.
# Source and destination paths
$sourcePath = "C:\source"
$destinationPath = "C:\destination"
# Get only the top-level folders
$folders = Get-ChildItem -Path $sourcePath -Directory
# Copy each folder
foreach ($folder in $folders) {
Copy-Item -Path $folder.FullName -Destination $destinationPath -Container