Skip to content

Instantly share code, notes, and snippets.

@bradleykronson
bradleykronson / del-umbraco-17-user.sql
Last active June 23, 2026 15:50
Delete Umbraco 17 user
DECLARE @UserId INT = 6; -- Replace with actual user ID
DECLARE @NewOwnerId INT = 4; -- Replace with ID of user to reassign content to (-1 = admin)
DECLARE @UserEmail NVARCHAR(255) = 'user@example.com'; -- Or find by email
DECLARE @UserKey NVARCHAR(255) = '881c7002-72e2-49c4-ac8c-467114d14dd6'; -- will be replaced in code below
-- Find user ID by email if needed
-- SELECT @UserId = id FROM umbracoUser WHERE userEmail = @UserEmail;
@bradleykronson
bradleykronson / ai-prompt-codebase-rebuild.txt
Last active June 11, 2026 05:20
ai-prompt-codebase-rebuild
You are a senior full-stack software architect, codebase archaeologist, and technical documentation lead.
Task:
Analyze the full source code I provide for a web application and produce comprehensive rebuild documentation explaining how the app is put together and how it could be rebuilt using modern technologies.
Primary objective:
Create documentation detailed enough that a competent engineering team could understand, reproduce, modernize, and safely reimplement the application.
Context:
I will provide the complete source code for the app. You must inspect the codebase as evidence, not guess from framework conventions alone.
@bradleykronson
bradleykronson / U7 Member export.sql
Created April 30, 2026 16:32
Umbraco 7 Member export SQL
/* Core member export: one row per member */
SELECT
m.nodeId AS MemberId,
n.uniqueId AS MemberKey,
n.[text] AS MemberName,
m.LoginName AS Username,
m.Email,
ct.alias AS MemberTypeAlias,
ct.[description] AS MemberTypeName,
n.createDate,
@bradleykronson
bradleykronson / U7-Member-properties.sql
Created April 30, 2026 16:30
Umbraco 7 SQL Member export with properties
WITH CurrentMemberVersion AS
(
SELECT
cv.ContentId,
cv.VersionId,
ROW_NUMBER() OVER (
PARTITION BY cv.ContentId
ORDER BY cv.VersionDate DESC, cv.Id DESC
) AS rn
FROM cmsContentVersion cv
@bradleykronson
bradleykronson / ai-prompt-engineer
Created April 13, 2026 15:24
Use this to get an AI to give you the ideal to prompt for your requirements
You are a world-class prompt engineer. Your job is to create a high-performance prompt that another AI can execute reliably.
Transform my input into a prompt that is:
- precise
- unambiguous
- context-rich
- outcome-driven
- structured for strong output quality
When building the prompt, do this:
Act as a senior TypeScript SDK, React library, and Next.js architecture expert.
Your job is to generate a production-ready set of TypeScript libraries and supporting app-layer code for a Next.js website that wraps an API into strongly typed objects, clients, hooks, and domain models.
I will provide:
* a Postman collection
* a Postman environment
* one or more PDF documents with API, workflow, or business rules
* optionally example payloads, error responses, and usage notes
@bradleykronson
bradleykronson / ai-prompt-postman-collection
Last active April 7, 2026 08:00
ChatGPT prompt to create a Postman collection from a spec PDF
You are an expert API integration engineer. Your job is to read the attached PDF specification document and convert it into a complete, import-ready Postman collection JSON, plus all supporting setup instructions needed to use it properly.
What I want you to produce:
1. A valid Postman collection in Collection v2.1 JSON format.
2. A matching Postman environment JSON with all variables the collection needs.
3. A clear variable reference table showing:
* variable name
* purpose
@bradleykronson
bradleykronson / shrink-database.sql
Created February 29, 2024 13:06
Shink SQL Database
USE DatabaseName;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE DatabaseName
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (DatabaseName_Log, 1);
GO
-- Reset the database recovery model.
@bradleykronson
bradleykronson / SessionStorageCalc.js
Created October 25, 2021 10:46
Calculate size of object in session storage
var count = 0;
for (const property in app) {
try {
var l = JSON.stringify(app[property]).length;
count += l;
console.log(`${property}: ${l}`);
} catch(e) {
// meh
}
};
@bradleykronson
bradleykronson / umbraco.gitignore
Created August 4, 2021 13:29 — forked from amogram/umbraco.gitignore
A .gitignore file for Umbraco projects
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates