Skip to content

Instantly share code, notes, and snippets.

View patrickperrone's full-sized avatar

Patrick Perrone patrickperrone

View GitHub Profile
@patrickperrone
patrickperrone / functional-test.ps1
Last active August 31, 2017 13:43
Example Functional Test using LayoutSimulator integrated with Gulp
#Copy this file to the root of your Habitat repo
function Invoke-FunctionalTest
{
[CmdletBinding()]
param
(
[parameter(Position=0, Mandatory=$true)]
[string]$HostName,
@patrickperrone
patrickperrone / UninstallNancySitecoreShip.ps1
Last active March 13, 2017 18:47
Uninstall Nancy implementation of Sitecore.Ship
# uninstall Nancy version of Sitecore.Ship
$websitePath = "C:\inetpub\SIM\shipNancy\Website"
if (!(Test-Path $websitePath))
{
Write-Host "Cannot find the path $($websitePath)"
return
}
# Delete ship.config file
@patrickperrone
patrickperrone / solrconfig_snippet.xml
Last active August 29, 2015 14:24
Sample Master/Slave replication handler for solrconfig.xml
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="enable">${enable.master:false}</str>
<str name="replicateAfter">optimize</str>
<str name="replicateAfter">commit</str>
<str name="backupAfter">optimize</str>
<str name="backupAfter">commit</str>
<str name="confFiles">schema.xml,stopwords.txt,elevate.xml</str>
<str name="commitReserveDuration">00:00:10</str>
</lst>
@patrickperrone
patrickperrone / schema.xml
Created June 1, 2015 16:33
Solr schema file to be used with Sitecore 8 (tested through update 2)
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@patrickperrone
patrickperrone / glassv3item.tt
Created April 3, 2015 18:26
Glass code generation that includes a mapping for Rules field.
<#@ template language="C#" #>
<#@ output encoding="utf-8"#>
<#@ include file="Helpers.tt" #>
<#@ include file="StringExtensions.tt" #>
<#@ include file="GeneralExtensions.tt" #>
<#@ include file="Inflector.tt" #>
<#@ assembly name="System.Core.dll" #>
@patrickperrone
patrickperrone / install.ps1
Created March 28, 2015 17:09
Enforce "Copy Local = false" for DLL references added by NuGet. This script should be added under the Tools folder.
param($installPath, $toolsPath, $package, $project)
$asms = $package.AssemblyReferences | %{$_.Name}
foreach ($reference in $project.Object.References)
{
if ($asms -contains $reference.Name + ".dll")
{
$reference.CopyLocal = $false;
}
}
@patrickperrone
patrickperrone / castle_windsor_snippet.web.config
Last active November 2, 2017 07:38
Web.config workaround for Castle Windsor version conflict when using it as the IoC for Glass and Solr-enabled Sitecore 8.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!--
This assembly redirection is necessary to support
Glass and Solr simultaneously. GlassV3 wants to use
Castle 3.2+ and Solr wants 3.1. The snippet belows
assumes you want to use Castle 3.3 but it would also
work with 3.2.
-->
<dependentAssembly>
@patrickperrone
patrickperrone / ChangeSearchProvider.ps1
Last active November 2, 2017 11:00
This PowerShell script will change your Sitecore instance search provider from Lucene to Solr or vice versa.
function Get-ConfigFileFilter([string]$providerName)
{
return "^.*\." + $providerName + "\.(.+\.)?config.*$"
}
function Set-SCSearchProvider
{
$rootPath = Read-Host "What is the path of your Sitecore instance's website folder?";
$choice = Read-Host "(L)ucene or (S)olr?";