Skip to content

Instantly share code, notes, and snippets.

View JamesSkemp's full-sized avatar

James Skemp JamesSkemp

View GitHub Profile
@JamesSkemp
JamesSkemp / New Sitecore Ribbon Button.md
Last active June 22, 2017 08:35
Steps to create a new Sitecore ribbon button

Add a New Command Button to a Sitecore Ribbon

The following covers how to add a new button to the Sitecore ribbon.

The following Sitecore changes must be done in the core database.

Create a new Ribbon Chunk

/sitecore/content/Applications/Content Editor/Ribbons/Chunks/*group name*
@JamesSkemp
JamesSkemp / Helpful Commands.md
Last active January 16, 2016 02:15
Helpful PowerShell commands

Create a new file in current directory.

New-Item .gitignore -type file

Create a new directory.

New-Item c:\path\to\directory -type directory

Open Explorer for the current directory (Invoke-Item).

ii .
@JamesSkemp
JamesSkemp / GitPrompt.ps1
Last active November 13, 2015 01:45
Customized GitHub prompt file.
# Inspired by Mark Embling
# http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration
$global:GitPromptSettings = New-Object PSObject -Property @{
DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor
BeforeText = ' ['
BeforeForegroundColor = [ConsoleColor]::Yellow
BeforeBackgroundColor = $Host.UI.RawUI.BackgroundColor
DelimText = ' |'
@JamesSkemp
JamesSkemp / New PowerShell Profile.ps1
Created November 12, 2015 04:11
Create a new PowerShell profile
# Test whether a profile exists. If it does, you can skip the following.
Test-path $profile
# Creates a profile.
New-item –type file –force $profile
# Bonus 1: Edit the profile in Notepad.
notepad $profile
# Bonus 2: What you probably want if you have any startup scripts defined in PowerShell.
@JamesSkemp
JamesSkemp / iis_ssllabs_grade_a.ps1
Created October 18, 2015 00:24
Script from Alexander Hass to get an A on SSL Labs.
# J.Skemp: run Get-ExcutionPolicy and then Set-ExcutionPolicy Unrestricted before running the following.
# Make sure you set it back once done.
# Copyright 2014, Alexander Hass
# http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# Version 1.4
# - RC4 has been disabled.
# Version 1.3
# - MD5 has been disabled.
@JamesSkemp
JamesSkemp / Sitecore admin pages of note.md
Last active October 9, 2015 11:50
Sitecore admin pages of note
@JamesSkemp
JamesSkemp / Visual Studio solution file headers
Last active February 11, 2023 21:42
Visual Studio solution file headers - 2010, 2012, 2013, 2015
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
@JamesSkemp
JamesSkemp / Extract Frames from GIF.cs
Last active October 7, 2015 01:38
Extract frames from GIF
var imagePath = @"C:\Users\James\Desktop\HL0hEkH.gif";
var exportDirectory = @"C:\Users\James\SkyDrive\Projects\graphic samples\export\";
var exportPathFormat = exportDirectory + "{0}.png";
Image img = Image.FromFile(imagePath);
var totalFrames = img.GetFrameCount(FrameDimension.Time);
string.Format("Total frames: {0}", totalFrames).Dump();
@JamesSkemp
JamesSkemp / Elmah Log Parsing.linq
Created October 4, 2015 00:42
Parse ELMAH logs via LINQPad.
<Query Kind="Program" />
void Main()
{
// If false, will disable all debugging messages.
var debug = true;
// If true, files will not really be deleted.
var testingDeletions = false;
// If true, dump the file name of Elmah logs that are deleted.
var debugDumpDeletedFileName = true;
@JamesSkemp
JamesSkemp / SitecoreFQ-LockedItems
Created September 18, 2015 12:41
Sitecore - Fast query to find locked items
fast://*[@__lock='%domain%']