Skip to content

Instantly share code, notes, and snippets.

@kamsar
kamsar / SwitchMasterToWeb.config
Last active April 9, 2017 20:35
Sitecore 8 Patched SwitchMasterToWeb.config
<?xml version="1.0" encoding="utf-8" ?>
<!--
Purpose: This include file simplifies the setup of Sitecore CD instances by removing any references to the Master database from Sitecore configuration files.
This include file should be used only on CD servers.
Important: Include files are applied in alphabetical order. Therefore this include file cannot remove any references to the Master database
that are defined in include files that are applied later. In this situation, you must rename this include file so that it is applied after
any other include files that contain references to "master" database.
@magnetikonline
magnetikonline / gittruncatehistory.sh
Last active February 27, 2020 22:29
Truncate Git history to after specific SHA1, dropping everything at and before it.
#!/bin/bash -e
# Inspired by: https://github.com/adrienthebo/git-tools/blob/master/git-truncate
if [[ (-z $1) || (-z $2) ]]; then
echo "Usage: $(basename "$0") DROP_AT_SHA1 BRANCH"
exit 1
fi
if [[ ! $1 =~ ^[0-9a-f]{7,40}$ ]]; then
echo "Error: invalid Git commit SHA1" >&2