Skip to content

Instantly share code, notes, and snippets.

This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreif5fxj5eudcptuxsbjpkgyo4g6sqbrdo722ecgiwxnfj4pu7yv2ni ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@Adamsimsy
Adamsimsy / Sitecore-9-Dynamic-placeholder-key-format-fix.ps1
Last active July 22, 2020 01:04
Sitecore fix dynamic placeholder keys
$startPath = "/sitecore/content/home"
$placeholderKey = "*_*"
$outputFilePath = "C:\temp\placeholder-replacement-report.csv"
$results = @();
Write-Progress -Activity "Upgrading dynamic placeholders that for the key [$($placeholderKey)]" `
-Status "Getting content items"
Get-ChildItem -Path $startPath -Recurse -Version * | ForEach-Object {
@Adamsimsy
Adamsimsy / HelloWorldContract.sol
Created October 17, 2019 09:59
Solidity Hello World Contract Example
pragma solidity '0.5.11';
contract HelloWorldContract {
string private message;
constructor () public {
message = "Hello world!";
}
function setMessage(string memory newMessage) public {
@Adamsimsy
Adamsimsy / Run-SonarQube-Analysis-With-Docker-Persistent-Volumes-On-Windows.ps1
Last active September 17, 2019 04:46
.NET SonarQube with Docker persistent volumes on Windows
# Run as steps, not full script
#using docker image from https://hub.docker.com/_/sonarqube/
# Step 1 - Create docker volumes
docker volume create --name sonar-conf
docker volume create --name sonar-logs
docker volume create --name sonar-data
docker volume create --name sonar-extensions
@Adamsimsy
Adamsimsy / cache-no-login-safe.aspx
Last active August 15, 2019 08:38
Sitecore admin tools no login
<%@ Page language="c#" %>
<%@ Import Namespace="Sitecore" %>
<%@ Import Namespace="Sitecore.Diagnostics" %>
<%@ Import Namespace="Sitecore.Web" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.HtmlControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
{
"continent": {
"name": "North America",
"code": "NA"
},
"country": {
"name": "United States",
"isoCode": "US"
},
"city": "Atlanta",
@Adamsimsy
Adamsimsy / synonyms.txt
Created November 10, 2017 00:24
Apache SOLR term synonyms
#some test synonym mappings unlikely to appear in real input text
aaafoo => aaabar
bbbfoo => bbbfoo bbbbar
cccfoo => cccbar cccbaz
fooaaa,baraaa,bazaaa
# Some synonym groups specific to this example
GB,gib,gigabyte,gigabytes
MB,mib,megabyte,megabytes
Television, Televisions, TV, TVs
@Adamsimsy
Adamsimsy / CustomLinkProvider.cs
Created July 21, 2016 09:17
Sitecore custom link provider example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sitecore.Data.Items;
using Sitecore.Links;
namespace Sitemap.Custom
{
public class CustomLinkProvider : LinkProvider
@Adamsimsy
Adamsimsy / Sitecore Powershell change item template.ps1
Last active April 20, 2023 10:07
Sitecore Powershell examples
$item = Get-Item master:/content/home
$newTemplate = [Sitecore.Configuration.Factory]::GetDatabase("master").Templates["Sample/Sample Item"];
$item.ChangeTemplate($newTemplate)
@Adamsimsy
Adamsimsy / gist:cd20444034ca3718bf71b54c8153ccf3
Created May 7, 2016 18:12
Sitecore computed facet field
public class RelatedThemesFacet : IComputedIndexField
{
public string FieldName { get; set; }
public string ReturnType { get; set; }
public object ComputeFieldValue(IIndexable indexable)
{
var indexableItem = indexable as SitecoreIndexableItem;
if (indexableItem == null || indexableItem.Item == null)