Skip to content

Instantly share code, notes, and snippets.

View sebastiantecsi's full-sized avatar

Sebastian Tecsi sebastiantecsi

View GitHub Profile
@poojarsn
poojarsn / CustomSitecorePipeline.cs
Created March 7, 2018 03:42
Sitecore Pipeline HttpBeginRequest - Processor HttpRequestProcessor : Intercept requests before page get processed completely.
using Sitecore;
using Sitecore.Pipelines.HttpRequest;
using System.Web.Security;
namespace MyProject.Customm.Pipelines.HttpRequest
{
    /// <summary>
    ///     The pipeline processor intercept site setting EnabledMaintenance flag before request get processed.
    /// </summary>

This uses Chocolatey and Boxstarter to install a loadout for Sitecore/.NET development on a new computer. Click the link below to start a click-to-run that does all the things. It's that easy. Fork the gist and alter the link below to customize for your own usage!

Click here to start install

@RobsonAutomator
RobsonAutomator / pssolrservice.ps1
Created November 13, 2017 10:13
Install Solr as Windows Service without dependencies
#
# PSSolrService.ps1
#
<# region Description
###############################################################################
# #
# File name PSService.ps1 #
# #
# Description A sample service in a standalone PowerShell script #
# #
@blacktambourine
blacktambourine / JsonIndexableItem.cs
Created November 10, 2017 06:00
Custom Indexable item type for my non-sitecore data
using System;
using System.Collections.Generic;
using System.Globalization;
using MyCustomModels.Flights.Model;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Converters;
using Sitecore.Data;
using Sitecore.Diagnostics;
namespace Business.Search.Json
@jermdavis
jermdavis / SolrInstall-SIF-Extension.psm1
Last active November 23, 2021 13:29
A Sitecore Install Framework extension to install a development instance of Solr - Further detail at: https://blog.jermdavis.dev/posts/2017/solr-installs-with-sif
##
## private functions
##
#
# If necessary, download a file and unzip it to the specified location
#
function downloadAndUnzipIfRequired
{
Param(
@jermdavis
jermdavis / Install-Solr.ps1
Last active November 23, 2021 13:30
A PowerShell script to help installing Solr as a service - See https://blog.jermdavis.dev/posts/2017/low-effort-solr-installs for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
@anova
anova / sqlpackage.md
Last active November 3, 2022 20:31
Sqlpackage.exe samples

Export

Creates a .bacpac file from live database.

"C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:Export /scs:"Data Source=SERVER;Initial Catalog=db_name;Integrated Security=False;Persist Security Info=False;User ID=db_user;Password=db_password" /tf:"D:\backup\database_backup.bacpac"

Import

Import from .bacpac file to database.

@vince-geekcore
vince-geekcore / ee-warmup.js
Last active January 29, 2023 12:21
Sitecore Experience Editor 8.2-2 compatible warmup PhantomJS script to be triggered using Powershell (for example as Azure WebJob). Based on PhantomJS because it's already available on Sitecore 8 environments. Some paths are currently still hardcoded for webapps
var page = new WebPage(), testindex = 0, loadInProgress = false;
var args = require('system').args;
var host = args[1];
var username = args[2];
var password = args[3];
var pageEditorUrl = args[4];
var token;
var system = require('system');
phantom.cookiesEnabled = true;
phantom.javascriptEnabled = true;
@kamsar
kamsar / anexample.ps1
Last active October 18, 2023 14:27
Generate trusted local SSL cert for Solr
# Usage:
# This script is designed to be run after you have Solr running locally without SSL
# It will generate a trusted, self-signed certificate for LOCAL DEV (this must be modified for production)
# Notes: The keystore must be under server/etc on Solr root, and MUST be named solr-ssl.keystore.jks
# The cert will be added to locally trusted certs, so no security warnings in browsers
# You must still reconfigure Solr to use the keystore and restart it after running this script
#
# THIS SCRIPT REQUIRES WINDOWS 10 (for the SSL trust); without 10 remove the lines around trusting the cert.
@SynCap
SynCap / remove_node_modules_recursively.ps1
Last active May 5, 2025 13:25
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf