Skip to content

Instantly share code, notes, and snippets.

View vtml's full-sized avatar

Vincent Lui vtml

View GitHub Profile
@vtml
vtml / SearchQuery.cs
Created November 22, 2021 01:49 — forked from bic742/SearchQuery.cs
Extended Sitecore SearchQuery to support sorting and more complex search criteria
using GraphQL.Types;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Linq;
using Sitecore.ContentSearch.Linq.Utilities;
using Sitecore.ContentSearch.Utilities;
using Sitecore.Data;
using Sitecore.Data.Managers;
using Sitecore.Globalization;
using Sitecore.Services.GraphQL.Content.GraphTypes.ContentSearch;
using Sitecore.Services.GraphQL.GraphTypes.Connections;
@vtml
vtml / git-setup.sh
Created November 17, 2021 11:03 — forked from patik/git-setup.sh
Git and Node with Zscaler proxy
#!/bin/sh
# Git proxy settings
echo "Configuring Git..."
git config --global http.proxy http://gateway.zscaler.net:80/
git config --system http.proxy http://gateway.zscaler.net:80/
git config --global http.sslVerify false
git config --system http.sslVerify false
git config --global --unset http.sslcainfo
git config --system --unset http.sslcainfo
@vtml
vtml / Build.ps1
Created May 20, 2021 13:17 — forked from cassidydotdk/Build.ps1
Complete Build and Publish Script. Will deploy all projects to publishing target, no HPP required.
param(
[Parameter()]
[switch]$NoBuild,
[Parameter()]
[switch]$NoSync,
[Parameter()]
[string]$CmHost="https://habitatstarterkit.local",
[Parameter()]
[string]$SolutionName="HabitatStarterKit.sln",
[Parameter()]
@vtml
vtml / ImportWizardFromCSV.ps1
Created May 5, 2021 07:42 — forked from michaellwest/ImportWizardFromCSV.ps1
Import content from a CSV using Sitecore PowerShell Extensions.
<#
.SYNOPSIS
Data Import Wizard provides a way to generate or update content from an external file.
.DESCRIPTION
The import file uses the properties "Name" and "Id" to help match existing items.
.NOTES
Requires Sitecore PowerShell Extensions 4.6 or newer.
@vtml
vtml / Update workflow and state on content items.ps1
Last active May 5, 2021 05:17 — 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).
@vtml
vtml / pipelinesPerRequest.js
Created July 5, 2019 08:47 — forked from richardszalay/pipelinesPerRequest.js
Sitecore Pipelines admin tool :: Per Request Wall Time Summary
/*
Paste this into the dev tools console on sitecore/admin/pipelines.aspx for a summary of pipeline execution time per request
*/
(function() {
function pipelinesPerRequest() {
const pipelines = Array.from(document.querySelectorAll('.groupheader')).map(el => ({
pipeline: el.querySelector("*[pln-name]").innerText,
executions: parseInt(el.querySelector('*[title="#Executions"]').innerText, 10),
wallTime: parseInt(el.querySelector('*[title="Wall Time"]').innerText.replace(/[^\d\.]/g, ''), 10)
}))