Skip to content

Instantly share code, notes, and snippets.

View blacktambourine's full-sized avatar

Black Tambourine blacktambourine

View GitHub Profile
@blacktambourine
blacktambourine / Environment.Configuration.Dev.config
Created September 12, 2019 01:49
Sitecore 9.2 Dev Environment Performance Improvements
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<!-- START Dev environment optimisations-->
<settings>
<setting name="ContentTesting.AutomaticContentTesting.Enabled" value="false"/>
<setting name="Counters.Enabled" value="false"/>
<setting name="Xdb.Enabled" value="false"/>
<setting name="Xdb.Tracking.Enabled" value="false"/>
@blacktambourine
blacktambourine / azure.scaling.cd.config
Created April 11, 2018 05:14
CD Server scaling out
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<eventing defaultProvider="sitecore">
<eventQueueMonitor>
<!-- 180411 PS: increased this from 2 seconds to 10; fix for issue with CD instance scaling out -->
<processingInterval>00:00:10</processingInterval>
</eventQueueMonitor>
</eventing>
</sitecore>
@blacktambourine
blacktambourine / HtmlCacheClearer.config
Created April 6, 2018 08:10
Sitecore Clear Cache for all sites on publish
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<!--Clear the html cache on publish; default only clear for site called "website"-->
<events>
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>MyWebsite1</site>
<site>MyWebsite2</site>
</sites>
@blacktambourine
blacktambourine / select_filesize.sql
Created November 21, 2017 02:01
Get the largest files in your Sitecore database
SELECT ID, [Name], cast([dbo].[SC_GetSharedFieldValue] (ID, '{6954B7C7-2487-423F-8600-436CB3B6DC0E}') as int) AS FileSize
FROM [dbo].[Items]
ORDER BY FileSize DESC
@blacktambourine
blacktambourine / SC_GetSharedFieldValue.sql
Created November 21, 2017 01:55
Sitecore database function to get a field for an item
CREATE FUNCTION [dbo].[SC_GetSharedFieldValue]
(
@ItemID [uniqueidentifier],
@FieldID [uniqueidentifier]
)
RETURNS nvarchar(max)
AS
BEGIN
DECLARE @Result nvarchar(max)
SELECT @Result = value
@blacktambourine
blacktambourine / FlightInfo.Search.config
Created November 10, 2017 06:02
Flight Info Index Config
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<!-- add in the flights search index -->
<index id="flight_json_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
<param desc="name">$(id)</param>
@blacktambourine
blacktambourine / JsonIndexableItem.cs
Created November 10, 2017 06:00
Custom Indexable item type for my non-sitecore data
using System;
using System.Collections.Generic;
using System.Globalization;
using MyCustomModels.Flights.Model;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Converters;
using Sitecore.Data;
using Sitecore.Diagnostics;
namespace Business.Search.Json
@blacktambourine
blacktambourine / FidsJsonTask.cs
Last active November 14, 2017 03:17
Task Agent to call webservice for Json data
using Sitecore.Data;
using Sitecore.Sites;
using System;
using Sitecore.Configuration;
using Sitecore.ContentSearch;
namespace Flights.Tasks
{
public class FidsJsonTask
{
@blacktambourine
blacktambourine / FidsJsonItemCrawler.cs
Last active November 13, 2017 08:01
Custom Item Crawler for Lucene to crawl Json data
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using Newtonsoft.Json;
//using CustomModel.Flights.Model;
using Sitecore.Collections;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Abstractions;
@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