Skip to content

Instantly share code, notes, and snippets.

@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
@bradleykronson
bradleykronson / get-macro-param.cs
Last active July 17, 2017 06:21
Get Macro Parameter
public TType GetMacroParam<TType>(PartialViewMacroModel model, string key, Func<string, TType> convert, TType fallback)
{
if(!model.MacroParameters.ContainsKey(key))
{
return fallback;
}
var value = model.MacroParameters[key];
if(value == null || value.ToString().Trim() == "")
@bradleykronson
bradleykronson / gitignore
Created March 31, 2017 06:59
Removes a file from the git cache so .gitignore kicks in. List of .gitignore starter files https://github.com/github/gitignore
Git features a ‘remove’ command, git rm. You can use it to remove files from git’s tracking cache, like so:
git rm --cached <filename>
1
git rm --cached <filename>
The above command is for a specific file. It will take effect with your next commit. It’s a good idea for you to commit any pending changes you have before you start this process. If you have many files and/or folders (for instance, your /bin and /obj folders in a .NET project) that you need to clean up from your repository, you can use the following commands to remove them from the index (cache):
git rm -r --cached .
1