Skip to content

Instantly share code, notes, and snippets.

View sebastiantecsi's full-sized avatar

Sebastian Tecsi sebastiantecsi

View GitHub Profile
@michaellwest
michaellwest / CleanupFields.sql
Last active October 19, 2021 10:16
Scripts for use with cleaning up Sitecore tables.
-- Find field data not associated with an item.
SELECT Id FROM SharedFields f
WHERE NOT EXISTS (SELECT ID FROM Items i WHERE i.ID = f.ItemId)
SELECT Id FROM UnversionedFields f
WHERE NOT EXISTS (SELECT ID FROM Items i WHERE i.ID = f.ItemId)
SELECT Id FROM VersionedFields f
WHERE NOT EXISTS (SELECT ID FROM Items i WHERE i.ID = f.ItemId)
@vtml
vtml / choco-packages-for-sitecore-docker-build.ps1
Last active March 10, 2021 09:35
A list of Chocolatey packages required to install on a Windows VM to build Sitecore Docker Containers
Set-ExecutionPolicy RemoteSigned -Force; Set-ExecutionPolicy Unrestricted -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install dotnetcore -y
choco install dotnetcore-sdk -y
choco install webdeploy -y
choco install dotnetfx -y
choco install netfx-4.8 -y
choco install powershell-core -y
choco install azure-cli -y
choco install git -y
choco install sourcetree -y
@michaellwest
michaellwest / CleanupTables.sql
Last active February 12, 2024 01:27
Remove entries in the Sitecore Publishing Service queue using PowerShell.
Import-Function -Name Invoke-SqlCommand
$connection = [Sitecore.Configuration.Settings]::GetConnectionString("master")
$query = @"
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_ActivationLock]
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_Data_Params_FieldIds]
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_Data_Params_Languages]
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_JobManifest]
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_JobMetadata]
@MonrealRyan
MonrealRyan / Delete SOLR in Ubuntu.md
Last active May 23, 2023 20:53
Deleting SOLR in Ubuntu server
  1. sudo service solr stop

  2. sudo rm -r /var/solr

  3. sudo rm -r /opt/solr-5.3.1

  4. sudo rm -r /opt/solr

  5. sudo rm /etc/init.d/solr

@michaellwest
michaellwest / Spe.ShieldsDown.config
Created August 19, 2020 01:38
Example to turn off some of the security features for local development with Sitecore PowerShell Extensions. https://alan-null.github.io/2017/01/spe-dev-config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<powershell>
<services>
<remoting>
<patch:attribute name="enabled">true</patch:attribute>
<authorization>
<add Permission="Allow" IdentityType="User" Identity="sitecore\admin" />
</authorization>
</remoting>
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@poojarsn
poojarsn / RedisCacheProvider.cs
Last active December 18, 2020 05:36
Azure Redis cache asp.net provider
public interface ICacheProvider
{
T Get<T>(string key, Func<T> fetch) where T : class;
IEnumerable<T> GetAll<T>(IReadOnlyCollection<string> keys, Func<IEnumerable<T>> fetch, Func<T, string, string> keyGen, string keyPrefix) where T : class;
void Clear(string key);
}
//Encryt and decrypt
//Logging service
//Key for different env same shared redis cache

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@EdCharbeneau
EdCharbeneau / ExampleMetadata.cs
Last active May 3, 2020 14:28
Create a menu from Application components.
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
public static class ExampleMetadata
{
public static IEnumerable<MenuItem> GetItems()