Skip to content

Instantly share code, notes, and snippets.

Jeremy Davis jermdavis

View GitHub Profile
@jermdavis
jermdavis / SolrInstall-SIF-Extension.psm1
Last active Mar 4, 2019
Installing Solr for Sitecore v9.1 using SIF's createcert.json - Blog post explaining this at: https://jermdavis.wordpress.com/2019/03/04/a-second-attempt-at-installing-solr-with-sif/
View SolrInstall-SIF-Extension.psm1
##
## private functions
##
#
# If necessary, download a file and unzip it to the specified location
#
function downloadAndUnzipIfRequired
{
Param(
@jermdavis
jermdavis / Either.cs
Created Feb 17, 2019
An attempt at an error-friendly pipeline
View Either.cs
public struct Either<SUCCESS, FAILURE>
{
private readonly bool _isSuccess;
private readonly SUCCESS _success;
private readonly FAILURE _failure;
public bool IsSuccess => _isSuccess;
public bool IsFailure => !IsSuccess;
public SUCCESS SuccessValue => _success;
@jermdavis
jermdavis / BasicPipeline.cs
Created Feb 15, 2019
An alternative example of a generic pipeline which includes logging behaviour
View BasicPipeline.cs
using System;
namespace LoggingPipeline
{
public interface IPipelineStep<INPUT, OUTPUT>
{
OUTPUT Process(INPUT input);
}
@jermdavis
jermdavis / AdvancedCache.aspx
Created Nov 27, 2018
A fix to make https://briancaos.wordpress.com/2017/05/01/sitecore-caching-clear-caches-individually/ work on Sitecore 8, plus a quick hack to view the contents of each cache
View AdvancedCache.aspx
<%@ Page language="c#" EnableEventValidation="false" AutoEventWireup="true" EnableViewState="false" %>
<%@ Import Namespace="System.Security.Permissions" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Security.Principal" %>
<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
Response.Buffer = false;
@jermdavis
jermdavis / FunctionScheduler.cs
Last active May 12, 2018
Simple scheduler class
View FunctionScheduler.cs
using System;
using System.Threading;
public class FunctionScheduler
{
private int _runEveryMs;
private Action _actionToRun;
private Timer _timer = null;
private object _lock = new object();
View ConfigServerRole.ps1
param(
[Parameter(Mandatory=$true)]
[string]$configFolder,
[Parameter(Mandatory=$true)]
[string]$configPattern,
[Parameter(Mandatory=$true)]
[string]$currentRoles
)
function Update-ConfigFile
@jermdavis
jermdavis / DownloadFromSitecore.ps1
Last active Nov 27, 2017
Download files from dev.sitecore.net from the commandline
View DownloadFromSitecore.ps1
param(
[Parameter(Mandatory=$true)]
[string]$url,
[Parameter(Mandatory=$true)]
[string]$target
)
function Fetch-WebsiteCredentials
{
$file = "dev.creds.xml"
@jermdavis
jermdavis / SolrInstall-SIF-Extension.psm1
Last active Mar 3, 2019
A Sitecore Install Framework extension to install a development instance of Solr - Further detail at: https://jermdavis.wordpress.com/2017/11/13/solr-installs-with-sif/
View SolrInstall-SIF-Extension.psm1
##
## private functions
##
#
# If necessary, download a file and unzip it to the specified location
#
function downloadAndUnzipIfRequired
{
Param(
@jermdavis
jermdavis / Install-Solr.ps1
Last active Mar 6, 2019
A PowerShell script to help installing Solr as a service - See https://jermdavis.wordpress.com/2017/10/30/low-effort-solr-installs/ for details
View Install-Solr.ps1
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
View 51DegreesIntegrationTests.cs
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Sitecore.FiftyOneDegrees.CloudDeviceDetection.Services;
using Sitecore.FiftyOneDegrees.CloudDeviceDetection.Settings;
using Sitecore.FiftyOneDegrees.CloudDeviceDetection.System.Wrappers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Web;
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.