Skip to content

Instantly share code, notes, and snippets.

View harshbaid's full-sized avatar

Harsh Baid harshbaid

View GitHub Profile
@harshbaid
harshbaid / install.mongodb.service.bat
Created June 20, 2017 22:15
Install MongoDB as Windows Service
mongod --dbpath=D:\mongodb --logpath=D:\mongodb\log.txt --install
REM Reference link: <http://stackoverflow.com/questions/2438055/how-to-run-mongodb-as-windows-service>
@harshbaid
harshbaid / Cleanup.Solr.Cores.bat
Last active June 20, 2017 22:17
Command-line script to Setup or Cleanup Solr indexes for Sitecore
ECHO 'Starting to delete Sitecore's Solr cores'
REM solr start -p 8080
REM d:\solr\bin\solr delete -c sitecore_core_index
CALL d:\solr\bin\solr delete -c sitecore_master_index
CALL d:\solr\bin\solr delete -c sitecore_web_index
CALL d:\solr\bin\solr delete -c sitecore_web_index_rebuild
CALL d:\solr\bin\solr delete -c sitecore_marketing_asset_index_master
CALL d:\solr\bin\solr delete -c sitecore_marketing_asset_index_web
CALL d:\solr\bin\solr delete -c sitecore_marketing_asset_index_web_rebuild
CALL d:\solr\bin\solr delete -c sitecore_marketingdefinitions_master
@harshbaid
harshbaid / zzz.Custom.Solr.Index.Patch.xml
Last active June 20, 2017 22:22
Solr for Sitecore - Switch on Rebuild patch configs
<!-- zzz.Custom.Solr.Index.Patch.config -->
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="sitecore_web_index">
<patch:attribute name="type" value="Sitecore.ContentSearch.SolrProvider.SwitchOnRebuildSolrSearchIndex, Sitecore.ContentSearch.SolrProvider" />
<param patch:after="*[@desc='core']" desc="rebuildcore">$(id)_rebuild</param>
@harshbaid
harshbaid / SelectRendering.xml
Created June 22, 2017 19:53 — forked from jammykam/SelectRendering.xml
Updated Sitecore Tabbed Select Rendering Dialog
<?xml version="1.0" encoding="utf-8" ?>
<control xmlns:def="Definition" xmlns="http://schemas.sitecore.net/Visual-Studio-Intellisense">
<Sitecore.Shell.Applications.Dialogs.SelectRendering>
<FormDialog ID="Dialog" Icon="Core/32x32/open_document.png" Header="Open Item"
Text="Select the item that you wish to open. Then click the Open button." OKButton="Open">
<Stylesheet Src="SelectItemWithThumbnails.css" DeviceDependant="true" />
<CodeBeside Type="MyProject.Custom.Dialogs.SelectRenderingTabbed.SelectRenderingForm, MyProject.Custom"/>
<DataContext ID="DataContext" Root="/"/>
using Sitecore;
using Sitecore.Diagnostics;
using Sitecore.Resources;
using Sitecore.Web.UI;
using Telerik.Web.UI;
using Sitecore.Data.Items;
namespace RTEDropList
{
public class EditorConfiguration : Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration
@harshbaid
harshbaid / ProxyForFiddler.config
Created October 3, 2018 20:47 — forked from michaellwest/ProxyForFiddler.config
Snippet to be added in the web.config, app.config, or machine.config to redirect traffic to the Fiddler proxy.
<system.net>
<defaultProxy enabled = "true" useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
@harshbaid
harshbaid / TransferAssignedSecurityToAnotherRole.ps1
Created October 3, 2018 20:48 — forked from michaellwest/TransferAssignedSecurityToAnotherRole.ps1
Finds items with a specified user or role assigned and transfers to another role in Sitecore PowerShell Extensions.
<#
.SYNOPSIS
Find all items with the specified user or role assigned.
.DESCRIPTION
This report helps identify all of the items with a specific user or role assigned and transfers to another role.
.NOTES
Michael West
#>
@harshbaid
harshbaid / Update workflow and state on content items.ps1
Created October 3, 2018 20:55 — forked from marcduiker/Update workflow and state on content items.ps1
Sitecore Powershell script to update the workflow and state on content items which do not have a workflow set on them.
<#
.SYNOPSIS
Updates the Workflow and Workflow state fields of content items with the given $workflowID and $workflowStateID values.
.DESCRIPTION
This script can be used when existing content is not assigned to a workflow and workflow state while it should be.
This scenario usually occurs when a workflow is assigned to a template but there is already content created based on a previous version of that template (where the workflow was not yet assigned).
@harshbaid
harshbaid / FindKeywordInAllFields.ps1
Created October 3, 2018 20:56 — forked from michaellwest/FindKeywordInAllFields.ps1
Search all fields for a keyword using Sitecore PowerShell Extensions.
<#
.SYNOPSIS
Find all of the items and fields which contain a specific text.
.LINK
https://vandsh.github.io/sitecore/2018/01/27/spe-search-replace.html
#>
$rootItem = Get-Item -Path "master:/sitecore/content/Home"
$needle = "nurse"
@harshbaid
harshbaid / .gitconfig
Last active October 31, 2018 15:35 — forked from DamianReeves/.gitconfig
Using Visual Studio AS Git Merge Tool
[diff]
tool = vsdiffmerge
[difftool]
prompt = true
[merge]
tool = vsdiffmerge
[mergetool]
prompt = true
[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //ignorespace //t