Skip to content

Instantly share code, notes, and snippets.

$user = Get-User -Current
$serializedData = $user.Profile.GetPropertyValue("SerializedData")
if ($serializedData -is [System.Collections.IDictionary]) {
# Update the key based on previous script output
$gutterKey = "$($user.LocalName)/Content Editor/Gutter Renderers"
Write-Host "Looking for key: $gutterKey" -ForegroundColor Yellow
$user = Get-User -Current
Write-Host "User: $($user.Name)" -ForegroundColor Cyan
Write-Host "========================`n" -ForegroundColor Cyan
$profile = $user.Profile
$propertiesCollection = $profile.Properties
Write-Host "Found $($propertiesCollection.Count) properties`n" -ForegroundColor Yellow
EXEC sp_MSforeachdb '
IF ''?'' LIKE ''%Xdb.Collection.Shard%''
BEGIN
USE [?];
SELECT
DB_NAME() AS DatabaseName,
name AS FileName,
type_desc AS FileType,
size/128 AS CurrentSizeMB,
size/128.0 - CAST(FILEPROPERTY(name, ''SpaceUsed'') AS INT)/128.0 AS FreeSpaceMB,
@hishaamn
hishaamn / overlay.js
Last active September 19, 2025 16:52
<script>
window.toggleOverlayPanel = function() {{
var panel = document.getElementById('scxmPanel');
if (!panel) return;
var isOpen = panel.classList.toggle('open');
try {{
panel.setAttribute('aria-hidden', !isOpen);
localStorage.setItem('scxmPanelOpen', isOpen ? '1' : '0');
}} catch(e) {{
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Shell.Applications.ContentEditor.Pipelines.RenderContentEditor;
using Sitecore.Shell.Framework.CommandBuilders;
using Sitecore.Shell.Framework.Commands.TemplateBuilder;
using Sitecore.Shell.Web.UI.WebControls;
using System;
using System.IO;
private void RenderControl(Item child, StringBuilder commandsBuilder)
{
var header = child["Header"];
if (string.IsNullOrEmpty(header)) header = child.DisplayName;
var icon = child["Icon"] ?? child["__Icon"];
var click = child["Click"];
commandsBuilder.AppendLine("<div style='margin:6px 0;'>");
try
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<renderContentEditor>
<processor type="SCXM.Panels.Pipelines.RenderContentEditor.SlidePanelInjector, SCXM.Panels" />
</renderContentEditor>
</pipelines>
</sitecore>
</configuration>
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Shell.Applications.ContentEditor.Pipelines.RenderContentEditor;
namespace SCXM.Panels.Pipelines.RenderContentEditor
{
public class SlidePanelInjector
{
public void Process(RenderContentEditorArgs args)
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<services>
<configurator patch:instead="*[@type='Sitecore.Services.Infrastructure.DependencyInjection.ComponentServicesConfigurator, Sitecore.Services.Infrastructure']" type="MyServiceConfiguratorNamespace, MyAssemblyName"/>
</services>
</sitecore>
</configuration>