Skip to content

Instantly share code, notes, and snippets.

View blacktambourine's full-sized avatar

Black Tambourine blacktambourine

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / update.sql
Created October 30, 2017 06:14
Post Sitecore 9 install SQL script
:SETVAR DatabasePrefix sc9test_
:SETVAR UserName collectionuser
:SETVAR Password Test12345
:SETVAR ShardMapManagerDatabaseNameSuffix _Xdb.Collection.ShardMapManager
:SETVAR Shard0DatabaseNameSuffix _Xdb.Collection.Shard0
:SETVAR Shard1DatabaseNameSuffix _Xdb.Collection.Shard1
GO
IF(SUSER_ID('$(UserName)') IS NULL)
BEGIN