Skip to content

Instantly share code, notes, and snippets.

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

Chris Houston readingdancer

🏠
Working from home
View GitHub Profile
@readingdancer
readingdancer / TidyFolders.ps1
Created November 27, 2025 14:59
A PowerShell file organization script that sorts files into a clean 6-folder structure (Media, Documents, Development, Archives, Applications, Other) with automatic year-based subfolders for images/videos/audio/PDFs and format-based subfolders for images (JPG, PNG, PSD, Vector). Just place in any folder and run!
# ============================================================================
# TidyFolder.ps1
# ============================================================================
#
# Author: Chris Houston (chouston@vizioz.com)
# License: Open Source - MIT License
# Repository: https://github.com/user/TidyFolder (if applicable)
#
# Description: Organizes files into a structured folder hierarchy based on
# file type, with year-based organization for media files.
@readingdancer
readingdancer / Clean-GitBranches.ps1
Created August 6, 2025 12:47
A PowerShell script to clean up all old merged in branches both locally and on the origin server.
# First run this script with the test parameter to see what it plans to delete
# .\Clean-GitBranches.ps1 -Test
param(
[string]$TopBranch = $(git rev-parse --abbrev-ref HEAD),
[switch]$Test
)
Write-Host "`n🔍 Scanning for branches merged into '$TopBranch'..." -ForegroundColor Cyan
@readingdancer
readingdancer / Rebase-PRs.ps1
Created July 3, 2025 06:26
A PowerShell script that automatically rebases multiple pull request branches that were created from a specific old dev commit onto the latest dev branch.
param(
[Parameter(Position=0, Mandatory=$false)]
[string]$OldDevCommit,
[switch]$DryRun
)
function Show-Help {
Write-Host "Usage: .\Rebase-PRs.ps1 <old-dev-commit> [-DryRun]"
Write-Host ""
@readingdancer
readingdancer / Umbraco Terminal Shortcut
Last active July 2, 2025 20:20
Add clickable Umbraco URL to terminal output when running locally
// Add this to your program.cs file.
// Output the Umbraco URL for easy access (only when running on localhost)
app.Lifetime.ApplicationStarted.Register(() =>
{
var configuration = app.Services.GetRequiredService<IConfiguration>();
var urls = configuration["ASPNETCORE_URLS"] ?? configuration["urls"];
// Check if we have localhost URLs or fallback to checking app.Urls
var allUrls = new List<string>();
@readingdancer
readingdancer / Migrate.bat
Last active August 7, 2018 05:58
Migrate an SVN repo from Beanstalk to Github ( note this does not retain the history, that is more complex and was not required by me backing up some very old repos )
echo off
echo !
echo =====================================
echo = Script to migrate from SVN to GIT =
echo = By Chris Houston =
echo = https://www.vizioz.com =
echo =====================================
echo !
REM Usage: