Skip to content

Instantly share code, notes, and snippets.

public class MvpGlassUserControl<T,K,M> : GlassUserControl<M>
where T : IView<M>
where K : IPresenter
where M : class
{
protected T View { get; set; }
protected K Presenter { get; private set; }
protected override void OnLoad(EventArgs e)
{
@Adamsimsy
Adamsimsy / SwitchMasterToWeb-V7.config
Last active February 21, 2017 21:35
Revised #Sitecore7 SwitchMasterToWeb.config for Content Delivery to one available at http://sdn.sitecore.net/Reference/Sitecore%207/Scaling%20Guide.aspx . Some additional configuration was required to remove Master index configuration.
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<sites>
<site name="shell" set:content="web" />
<site name="modules_shell" set:content="web" />
<site name="testing">
<patch:delete />
</site>
</sites>
@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)
@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 / 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 / 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
{
"continent": {
"name": "North America",
"code": "NA"
},
"country": {
"name": "United States",
"isoCode": "US"
},
"city": "Atlanta",
@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" %>
@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