Skip to content

Instantly share code, notes, and snippets.

View jdylanmc's full-sized avatar
😎

Dylan McCurry jdylanmc

😎
  • Microsoft
  • Roswell, GA
View GitHub Profile
@jdylanmc
jdylanmc / UpdateVersion.ps1
Last active December 8, 2021 20:53
Update .net core CSProj file with version info.
param
(
[Parameter(Position=0, Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$csproj,
[Parameter(Position=1, Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$version
)
@jdylanmc
jdylanmc / ca.json
Last active January 20, 2021 14:37
Topojson for Canada
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdylanmc
jdylanmc / states-albers-10m.json
Last active January 11, 2021 22:08
states-albers-10m.json with Labels for some states
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdylanmc
jdylanmc / us-states.json
Created December 28, 2020 14:06 — forked from girliemac/us-states.json
TopoJSON: US Map by States
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdylanmc
jdylanmc / CacheService.Events.config
Last active July 27, 2020 21:18
Example of leveraging Sitecore Caching engine in custom code
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<events>
<!-- clear custom cache when publishing completes -->
<event name="publish:end">
<handler type="MySite.Services.CacheService, MySite.Services" method="Clear" />
</event>
<event name="publish:end:remote">
<handler type="MySite.Services.CacheService, MySite.Services" method="Clear" />
@jdylanmc
jdylanmc / Update workflow for all items.ps1
Created July 23, 2016 12:59 — forked from marcduiker/Update workflow for all items.ps1
Sitecore PowerShell action to update the workflow and workflow state for all items in the ListView of the report.
$processedItems = New-Object System.Collections.ArrayList
function SetWorkFlowAndState {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[Sitecore.Data.Items.Item]$Item,
[Parameter(Mandatory=$true)]
[Sitecore.Data.ID]$WorkflowID,
[Parameter(Mandatory=$true)]
$item = Get-Item master:/content/home
$newTemplate = [Sitecore.Configuration.Factory]::GetDatabase("master").Templates["Sample/Sample Item"];
$item.ChangeTemplate($newTemplate)
@jdylanmc
jdylanmc / New-MediaItem.ps1
Created July 23, 2016 12:43 — forked from AdamNaj/New-MediaItem.ps1
Create Media item from file on server drive
function New-MediaItem{
[CmdletBinding()]
param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[string]$filePath,
[Parameter(Position=1, Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$mediaPath)
@jdylanmc
jdylanmc / gist:6716db98a0c9d92ace60
Created October 30, 2015 19:29 — forked from komainu85/gist:2b5bf03018a85b5ab824
Dev sitecore 8 config from Alex Shyba
<!--
IMPORTANT: This configuration file is not intended for any production Sitecore installation.
Purpose: This include file contains some experimental optimizations that can speed up start-up.
Please, review each of the patched elements below and consider if some of the optimizations should be commented out due to the specifics of your solution.
Enabling this file without taking into account the specifics of your solution can have unexpected consequences.
To enable this include file, rename it to have a ".config" extension.