Skip to content

Instantly share code, notes, and snippets.

@metacurb
metacurb / delete-instances.ps1
Last active August 19, 2019 15:42
Delete all AWS EC2 instances in all regions via Windows Powershell
$regions = aws ec2 describe-regions --query Regions[*].[RegionName] --output text
foreach ($region in $regions) {
Write-Output "Terminating Instances in region: '$region'..."
aws configure set region $region
$ids = aws ec2 describe-instances --query "Reservations[*].Instances[*].{ID:InstanceId}" --output text --region $region
$idArray = $ids.Split([Environment]::NewLine)
foreach($id in $idArray) {
aws ec2 modify-instance-attribute --no-disable-api-termination --instance-id $id --region $region
@metacurb
metacurb / GenerateSprite.jsx
Last active March 21, 2019 18:05
A Photoshop script to make the sprite-creation process a little more manageable.
// Sprite Generator (Tested on CS5)
// Written by Beau August 2017.
// DESCRIPTION:
// This script will take the width and height of your document, and generate
// a sprite based on the number of images inside the document. The images
// will be automatically aligned. An alignment layer will be placed behind
// each image in the sprite, in case one needs to be changed, modified or
// removed.
@metacurb
metacurb / RatioExport.jsx
Last active October 17, 2023 00:35
A Photoshop script to hunt through second-level nested groups, duplicating those with a ratio for a new to a new document, and saving as a JPEG.
// Export Ratioed Images (Tested on CS5)
// Written by Beau August 2016.
// DESCRIPTION:
// This script will hunt through second-level nested groups, looking for those that have a ratio for a name
// * A new folder will be created on the Desktop to house the images
// * It will duplicate each ratio-named group to a new document
// * It will do a "Reveal all" on the new document to make sure that the image will be trimmed correctly
// * The transparent pixels will then be trimmed
// * The file is saved to the Desktop folder at max quality in JPEG format.