Skip to content

Instantly share code, notes, and snippets.

View blacktambourine's full-sized avatar

Black Tambourine blacktambourine

View GitHub Profile
@blacktambourine
blacktambourine / install.ps1
Last active January 29, 2022 10:47
Install Sitecore 9
#define parameters
$prefix = "sc9test_"
$PSScriptRoot = "C:\install\sitecore\9.0"
$XConnectCollectionService = "$prefix.xconnect"
$sitecoreSiteName = "$prefix.sc"
$SolrUrl = "https://solr-dev.precedent.local:8983/solr"
$SolrRoot = "C:\solr\solr-6.6.2"
$SolrService = "solr6.6.2"
$SqlServer = "localhost"
$SqlAdminUser = "sitecoreDev"
@blacktambourine
blacktambourine / SecurityRoleList.cs
Last active September 27, 2017 07:57
Custom Sitecore Field to get a dropdown list of Roles
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.HtmlControls;
using Sitecore.Security.Accounts;
using Control = Sitecore.Web.UI.HtmlControls.Control;
namespace BlackTambourine.Core.SC.FieldType
{
public class SecurityRoleList : Control
@blacktambourine
blacktambourine / mongoback7z.bat
Created September 19, 2017 02:11
mongo backup with 7zip to compress
@echo off
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
set dow=%%i
set month=%%j
set day=%%k
set year=%%l
)
set datestr=%month%_%day%_%year%
echo datestr is %datestr%
@blacktambourine
blacktambourine / ResultItem.cs
Created August 18, 2017 07:36
Search Result Mapping class
public class ResultItem
{
[IndexField("_name")]
public string Name { get; set; }
[IndexField("title_t")]
public string Title { get; set; }
}
@blacktambourine
blacktambourine / predicate.txt
Created August 18, 2017 07:35
predicate usage example
innerKeywordPredicate = innerKeywordPredicate.Or(x => x.IndexedContent.Like(w, fuzzyTolerance).Boost(25));
innerKeywordPredicate = innerKeywordPredicate.Or(x => x.PageChildContent.Like(w, fuzzyTolerance).Boost(25));
@blacktambourine
blacktambourine / FieldFacet.cs
Created August 18, 2017 07:34
Search Facet
public class FieldFacet
{
public FieldFacet()
{
}
public FieldFacet(string type, string name, string path, int count)
{
FacetType = type;
FacetName = name;
@blacktambourine
blacktambourine / aSpeedUp.config
Created July 13, 2017 04:28
Speed up Sitecore start times
<?xml version="1.0" encoding="utf-8" ?>
<!--
Purpose: When removing Social configs and Experience Editor configs, you still need these for Sitecore UI to work without errors.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
@blacktambourine
blacktambourine / SpeedUp.Ps1
Created July 13, 2017 04:25
Powershell to speed up Sitecore statup times
# SCRIPT CONFIG
# Set disable features to "true" for faster startup times, "false" re-enables them.
$disableFeatures= "true"
# Set the webroot of your Sitecore Website.
$sitecoreWebroot= "D:\inetpub\wwwroot\CoC\Website\"
# folder to backup these configs
@blacktambourine
blacktambourine / DEV.config
Created May 29, 2017 09:12
Sitecore Dev environment speed boost
<?xml version="1.0" encoding="utf-8" ?>
<!--
Purpose: When removing Social configs and Experience Editor configs, you still need these for Sitecore UI to work without errors.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
@blacktambourine
blacktambourine / filter.release.targets
Created April 28, 2017 02:37
Reduce Release Build times by not building external dependencies
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="ReferenceCleanup" BeforeTargets="BeforeBuild">
<!--Set Copy Local to False for Release Builds, where the DLL is not needed or already exists on the Sitecore install; used because MVC intellisense fails without these-->
<Message Text="Start Release Build Copy Local Cleanup" Importance="high" />
<ItemGroup>
<Reference Remove="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"/>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">