Skip to content

Instantly share code, notes, and snippets.

View blacktambourine's full-sized avatar

Black Tambourine blacktambourine

View GitHub Profile
@blacktambourine
blacktambourine / CleanupSitecore.bat
Created July 7, 2015 15:35
Cleanup Sitecore Website folder
@echo off
set websiteDir=%1
if not defined websiteDir
set websiteDir=E:\Websites\WEB.CORP\Website\
echo Website Root Directory - "%websiteDir%"
REM Clear App_Config\
set subDir=App_Config\
set delDir=%websiteDir%%subDir%
echo Clean "%delDir%"
rmdir /s /q "%delDir%"
@blacktambourine
blacktambourine / CleanupSitecoreRemote.bat
Created July 7, 2015 15:40
Cleanup Sitecore Remotely with MS Deploy
@echo off
REM environment defaults
set sitecoreURL=%1
if not defined sitecoreURL set sitecoreURL=https://site:8172/MSDeploy.axd
set sitecoreAppName=%2
if not defined sitecoreAppName set sitecoreAppName=SitecoreSite
set userName=%3
@blacktambourine
blacktambourine / BackupMongoDB
Created August 10, 2015 07:42
Backup a Windows based Mongo DB
@echo off
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
set dow=%%i
set month=%%j
set day=%%k
set year=%%l
)
set datestr=%month%_%day%_%year%
echo datestr is %datestr%
@blacktambourine
blacktambourine / SiteDefinition.config
Created August 19, 2015 05:38
Sitecore config file for setting up subsites
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site name="MainSite" patch:before="site[@name='website']"
virtualFolder="/"
physicalFolder="/"
rootPath="/sitecore/content/Main Site/"
startItem="/home"
database="web"
@blacktambourine
blacktambourine / CustomAntiForgeryTokenAttribute.cs
Last active March 17, 2016 08:51
Web API Antiforgery Attribute
using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Helpers;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
@blacktambourine
blacktambourine / services.js
Last active October 14, 2015 11:56
Angular JS Anti-forgery implementation
var corpServices = angular.module('corpApp.corpServices', ['ngResource']);
(function ()
{
//#region Common Service Methods
var serviceRootPath = '/api/';
//add anti-forgery token to all Authenticated GET and POST requests
var AntiForgeryRequest = function (enableCache)
@blacktambourine
blacktambourine / applicationHost.config
Created October 27, 2015 04:52
Web API JSON Dynamic Compression
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
@blacktambourine
blacktambourine / MediaFolder.js
Created November 18, 2015 02:57
Sitecore 8 Media Upload unzip fix
//Bug fix for Sitecore 8 Advanced File Uploader not unzipping files
var SitecoreMediaFolder = Class.create({
load: function () {
this.idSequence = 0;
this.uploaders = new Array();
var simpleButton = $(this.getButton("media:multiupload"));
var advancedButton = $(this.getButton("media:multiupload", "options=1"));
@blacktambourine
blacktambourine / WorkboxPlusConfig.cs
Created December 11, 2015 02:41
Sitecore Configuration File Parser
using System;
using System.Collections.Generic;
namespace BlackTambourine.Web.Helpers
{
public class WorkboxPlusConfig
{
public Dictionary<Guid, string> ItemTemplateNames { get; private set; }
public Dictionary<Guid, string> FilterableWorkflowStates { get; private set; }
public bool EnablePageLevelApproval { get; set; }
@blacktambourine
blacktambourine / WorkboxPlus.config
Created December 11, 2015 02:42
Sitecore Custom Config File
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<!--Workbox Plus Module Settings-->
<WorkboxPlus>
<configuration type="BlackTambourine.Web.Helpers.WorkboxPlusConfig, BlackTambourine.Web">
<!--Enable Page Level Approval - i.e. group children of Pages / Item together in the Workbox-->
<param name="EnablePageLevelApproval">true</param>