{{ message }}

Instantly share code, notes, and snippets.

# Richard Szalay richardszalay

Created Dec 5, 2016
Extract policy document as text in AWS
View extract-policy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 document.querySelector('#policy_document .ace_scroller').innerText
Created Feb 21, 2017
Copy-EC2SecurityGroupIngress.ps1
View Copy-EC2SecurityGroupIngress.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 <# .SYNOPSIS Copies all EC2 Security Group rules from one IP range to one or more other ranges, optionally removing the original IP's rules .DESCRIPTION Copies all EC2 Security Group rules from one IP range to one or more other ranges, optionally removing the original IP's rules .PARAMETER Region The AWS Region to apply the changes to .PARAMETER CurrentIpRange The IP Address or CIDR Range that should be used as a template when copying rules .PARAMETER NewIpRanges
Created Mar 24, 2017
Positioning a fixed header below the Sitecore Experience Editor ribbon
View PositionFixedNavBar-SC-Ext.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 // Repositions a position-fixed header so that it always appears under the SC experience editor ribbon // includes added support for the Sitecore Extensions Chrome extension and its support for hiding the ribbon entirely define(["sitecore"], function (Sitecore) { return { priority: 50, execute: function (context) { // TODO: Change this CSS selector to suit your application var FIXED_NAV_SELECTOR = 'nav'; // the 'cross piece' is a blank div that is sized to match the iframe content (where the actual ribbon is)
Last active Dec 3, 2020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # Resets the password for the default LXSS / WSL bash user, based on https://askubuntu.com/a/808425/697555 $lxssUsername = (Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss).DefaultUsername lxrun /setdefaultuser root bash -c "passwd$lxssUsername" lxrun /setdefaultuser $lxssUsername Created Aug 3, 2017 Applies the default console colors added in Windows 10 16256 (https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/) to older versions of Windows View Win10-16257-Console-Colors.reg This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Console] "ColorTable00"=dword:000c0c0c "ColorTable01"=dword:00da3700 "ColorTable02"=dword:000ea113 "ColorTable03"=dword:00dd963a "ColorTable04"=dword:001f0fc5 "ColorTable05"=dword:00981788 "ColorTable06"=dword:00009cc1 Last active Dec 29, 2017 Test-SitecoreAssemblyList.ps1 View Test-SitecoreAssemblyList.ps1 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  <# .SYNOPSIS Validates a Sitecore "Assembly list" (from dev.sitecore.net) against a folder .PARAMETER AssemblyList The assembly list text file downloaded from dev.sitecore.net .PARAMETER AssemblyFolder The folder containing the Sitecore assemblies to validate .PARAMETER CheckFileVersion If set, also verifies the file version. Requires loading the assembly, so should be invoked in an isolated powershell environment .NOTES Created Feb 26, 2018 Update Sitecore NuGet packages View Update-SitecorePackages.ps1 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  # Updates from a specific version to avoid conflicting names ("Sitecore.Framework", "Sitecore.Ship", etc)$SourceVersion = "9.0.171002" # Does late filtering to avoid redundant upgrades for packages that have already been upgrades as dependencies. Big time saver Get-Package |  Where-Object { $_.Id -like "Sitecore.*" } |  Foreach-Object {$id = $_.Id if ((Get-Package -ProjectName$_.ProjectName) | ?{ $_.Id -eq$id -and $_.Version -eq$SourceVersion}) { Update-Package -Id $_.Id -ProjectName$_.ProjectName -Version HighestPatch # Use HighestMinor for a full point release
Last active Apr 9, 2018
Invoke-SitecoreCommerceBootstrap
View Invoke-SitecoreCommerceBootstrap.psm1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 function Invoke-SitecoreCommerceBootstrap { param( [string]$Username = "sitecore\admin", [string]$Password = "b", [string]$IdentityServer = "https://localhost:5050", [string]$OpsServer = "https://localhost:5015" ) \$ErrorActionPreference = "Stop"
Created May 15, 2018
DiagnosticBlock for Sitecore Commerce
View DiagnosticBlock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /** This block is designed to assist with diagnosing data/pipeline issues within Sitecore Example: services.Sitecore().Pipelines(config => config .ConfigurePipeline(builder => builder .Add>("Before CalculateSellableItemListPriceBlock").Before(), order: 1001 )
Created Jun 27, 2018
View Patch-SitecoreCommercePolicySet.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 <# **Prototype** Updates the properties of one or more Sitecore Commerce policies in a policy set or environment json file. # Patch all policies from another file Patch-SitecoreCommercePolicySet -Path "path\to\policy.json" -SourcePath "path\to\source.json" # Patch a specific policy from another file Patch-SitecoreCommercePolicySet -Path "path\to\policy.json" -SourcePath "path\to\source.json" -PolicyType "Fully.Qualified.Type, With.Assembly.But.Spaces.Are.Ignored"