Skip to content

Instantly share code, notes, and snippets.

View sebastiantecsi's full-sized avatar

Sebastian Tecsi sebastiantecsi

View GitHub Profile
@janhebnes
janhebnes / gist:3962756
Created October 27, 2012 02:44
Sitecore CMS - PageNotFound 404 handling using a Sitecore Item as ErrorPage
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Diagnostics;
using Sitecore.Layouts;
using Sitecore.Pipelines.HttpRequest;
@tomekjuranek
tomekjuranek / gist:4109920
Created November 19, 2012 09:59
sitecore configuration transformation
<Target Name="TransformConfigFiles" AfterTargets="AfterBuild" Condition="'$(TransformConfigFiles)'=='true'">
<Copy SourceFiles="Web.config" DestinationFiles="Web.Original.config" />
<Copy SourceFiles="$(WebProjectOutputDir)\App_Config\ConnectionStrings.config" DestinationFiles="$(WebProjectOutputDir)\App_Config\ConnectionStrings.Original.config" />
<TransformXml Source="Web.Original.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(WebProjectOutputDir)\Web.config" />
<TransformXml Source="$(WebProjectOutputDir)\App_Config\ConnectionStrings.Original.config" Transform="$(WebProjectOutputDir)\App_Config\ConnectionStrings.$(Configuration).config" Destination="$(WebProjectOutputDir)\App_Config\ConnectionStrings.config" />
</Target>
@ebdrup
ebdrup / test.js
Created June 23, 2013 16:20
Logging your own error with Muscula
try {
//your code, that may cause an error...
} catch(ex){
Muscula.errors.push(ex); //Log error to Muscula
}
@Refactored
Refactored / EncodeNameReplacements.config
Created December 5, 2013 14:48
Sitecore App_Config\Include overrides to get encodeNameReplacements to replace spaces with dashes. This also shows using display names with linkProvider.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<encodeNameReplacements>
<replace mode="on" find=" " replaceWith="-" />
</encodeNameReplacements>
</sitecore>
</configuration>
@onlime
onlime / accounts.list
Last active May 4, 2023 12:08
imapsync script to migrate multiple IMAP accounts in a row
# <SRCUSER> <SRCPW> <DSTUSER> <DSTPW>
@baconapplications
baconapplications / TestPublishExcludeFilesAndDirs.pubxml
Created October 8, 2014 06:07
pubxml exclude files and directories
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<publishUrl>F:\Projects\publish</publishUrl>
@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.
#
# MongoDB (as a windows service)
#
$mongoDbPath = "$env:SystemDrive\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-3.2.7.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-3.2.7"
if ((Test-Path -path $mongoDbPath) -eq $false)
@kamsar
kamsar / Performance.Dev.config
Last active August 17, 2021 16:04
SItecore 8.0/8.1/8.2 Performance Config
<!--
A set of performance optimizations for development that vastly increase application startup time.
Should not be used in production, as they largely disable forensic diagnostics that you'd want there over fast startup time after a compile.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<hooks>
<hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel">
<patch:delete />
@objarni
objarni / Install Gulp.txt
Last active January 16, 2023 13:30
Installing gulp in Windows
1. Install nodejs. https://nodejs.org/en/
2. Check npm (node package manager) is installed via command prompt:
$ npm
3. Install gulp:
$ npm install gulp --global
4. In relevant project folder, create 'gulpfile.js':