This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A subset of XP0_SingleDeveloper.ps1 for creating duplicate ID servers for plugin development. | |
# Note values marked "UPDATE FROM EXISTING" should be updated based on a working starting point ID server (installed using SIF or the | |
# graphical installer). | |
# The Prefix that will be used on SOLR, Website and Database instances. | |
$Prefix = "UPDATE FROM EXISTING" | |
# The root folder with the license file and WDP files. | |
$SCInstallRoot = "C:\ResourceFiles" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
# Input file | |
[Parameter()] | |
[String] | |
$InputFile, | |
[Parameter()] | |
[Switch] | |
$FormatForSql | |
) | |
$output = Get-Content $InputFile | % {[Regex]::match($_, "^.{36}(.{36})").Groups[1].Value} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" %> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title>Session Info</title> | |
</head> | |
<body> | |
<h1>Session Info</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG BASE_IMAGE | |
FROM $BASE_IMAGE | |
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] | |
ARG BRAINTREE_ENVIRONMENT | |
ARG BRAINTREE_MERCHANT_ID | |
ARG BRAINTREE_PUBLIC_KEY | |
ARG BRAINTREE_PRIVATE_KEY | |
RUN $json = Get-Content "C:\inetpub\wwwroot\wwwroot\data\Environments\PlugIn.Payments.Braintree.PolicySet-1.0.0.json" | ConvertFrom-Json; \ | |
$json.Policies.'$values'[0].Environment = $env:BRAINTREE_ENVIRONMENT; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<initialize> | |
<processor type="Sitecore.SharedSource.Pipelines.WriteShowConfigToLog.Processor, Sitecore.SharedSource.WritreShowConfig" patch:before="processor[1]"/> | |
</initialize> | |
</pipelines> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$csprojdirs = gci . -recurse -filter "*.csproj" | %{[System.IO.Path]::GetDirectoryName($_.FullName)} |sort|unique | |
$packagedirs = gci . -recurse -filter "packages.config" | %{[System.IO.Path]::GetDirectoryName($_.FullName)} |sort|unique | |
compare-object -referenceobject $csprojdirs -differenceobject $packagedirs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ($prefix = $(throw "-prefix is required")) | |
$client = (New-Object System.Net.WebClient) | |
[xml]$coresXML = $client.DownloadString("http://localhost:8983/solr/admin/cores") | |
$cores = $coresXML.response.lst[2].lst | % {$_.name} | |
$success = 0 | |
$error = 0 | |
foreach ($core in $cores) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using FluentAssertions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Powershell Script for creating a 3x5 shard cluster | |
# Based on Mongo University M101 lecture, "Building a Shared Environemnt" https://youtu.be/dn45G2yw20A | |
$rootpath = "/temp/mongoshards/" | |
new-module -scriptblock {function report($text) { | |
write-output $("-" * $text.length) | |
write-output $text | |
write-output $("-" * $text.length) | |
write-output "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demonstration code for StackOverflow question: http://stackoverflow.com/questions/33301106/query-lucene-index-against-ienumerable-field | |
// Shows that a field can be ignored from mapping and used in a linq query. | |
// Paste code into /sitecore/admin/linqscratchpad.aspx | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Web; |