Skip to content

Instantly share code, notes, and snippets.

@davidknipe
davidknipe / CreateGetaCategoriesFromEpiserverCategoriesJob.cs
Created Oct 10, 2019
Create Geta Categories based on existing Episerver category structure
View CreateGetaCategoriesFromEpiserverCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
using Geta.EpiCategories.Extensions;
@davidknipe
davidknipe / MigrateContentToGetaCategoriesJob.cs
Last active Oct 13, 2019
Migrates content to use Geta Categories. Note will only migrate categories that exist in the Geta Categories structure.
View MigrateContentToGetaCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.Security;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
@davidknipe
davidknipe / PostClickInterceptor.cs
Last active Aug 6, 2019
Episerver tracking data interceptor to create Episerver Campaign post clicks from Episerver Insight tracking events
View PostClickInterceptor.cs
using System.Configuration;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Hosting;
using Episerver.Marketing.Common.Helpers;
using EPiServer.ServiceLocation;
using EPiServer.Tracking.Commerce.Data;
using EPiServer.Tracking.Core;
using EPiServer.Tracking.PageView;
View BuyBundleGetItemDiscount.cs
namespace EPiServer.Reference.Commerce.Site.Features.Promotions
{
using System.ComponentModel.DataAnnotations;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Commerce.Marketing;
using EPiServer.Commerce.Marketing.DataAnnotations;
using EPiServer.Core;
using EPiServer.DataAnnotations;
@kamsar
kamsar / anexample.ps1
Last active Nov 29, 2020
Generate trusted local SSL cert for Solr
View anexample.ps1
# 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.
View FindExtensions.cs
namespace EPiServer.SocialAlloy.Web.Business.FindHelpers
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using EPiServer.Core;
using EPiServer.Find;
@jstemerdink
jstemerdink / ImageFile.cs
Last active Apr 3, 2017
Tag your images by using the Microsoft Computer Vision API.
View ImageFile.cs
using System.ComponentModel.DataAnnotations;
using Episerver.Playground10.Models.Properties;
using EPiServer.Core;
using EPiServer.DataAnnotations;
using EPiServer.Framework.DataAnnotations;
using EPiServer.Web;
[ContentType(GUID = "0A89E464-56D4-449F-AEA8-2BF774AB8730")]
@akshaysura
akshaysura / HabitatSolutionScript.ps1
Created Jan 21, 2017
Create a Sitecore Helix solution from scratch using PowerShell
View HabitatSolutionScript.ps1
#paths to the project templates on your system
$global:classTemplate = "D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplatesCache\CSharp\Windows Root\Windows\1033\ClassLibrary\csClassLibrary.vstemplate"
$global:webTemplate = "D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplatesCache\CSharp\Web\1033\WebApplicationProject40\EmptyWebApplicationProject40.vstemplate"
#variable used to store the path for the empty Habitat folder
$global:helixPath =""
#empty variable used to store the solution name
$global:solutionName = ""
@mackuba
mackuba / macbook-pro-2016.md
Created Jan 18, 2017
MacBook Pro 2016 - an iOS developer's review
View macbook-pro-2016.md

MacBook Pro 2016 - an iOS developer's review

Here are some thoughts about my new MacBook Pro that I've been using for the last few weeks (the Santa Claus from DHL brought it to me just before Christmas), hopefully this will help someone who's considering getting one.

Note: this is written from the perspective of a person who switched to the MBP from a 2015 13" MacBook Air (i7) and also has a 2012 21" iMac. Your experiences will obviously be different if you have e.g. a fairly recent 15" Retina MacBook Pro.

Specs

  • MacBook Pro 15", late 2016
  • Core i7 2.9 GHz (4 cores)
@nzpcmad
nzpcmad / AssignOAuth2SecurityRequirements.cs
Last active Jun 27, 2017
Using Swagger for Implicit Grant on Azure AD
View AssignOAuth2SecurityRequirements.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Swashbuckle;
using Swashbuckle.Swagger;
using System.Web.Http.Description;
namespace TodoListService