Skip to content

Instantly share code, notes, and snippets.

View john-mckillip's full-sized avatar
🤖
Back to the future too.

John McKillip john-mckillip

🤖
Back to the future too.
View GitHub Profile
public class ProductComponent : IComponent
{
private readonly IExamineManager _examineManager;
private readonly ProductIndexCreator _productIndexCreator;
public ProductComponent (IExamineManager examineManager, ProductIndexCreator productIndexCreator)
{
_examineManager = examineManager;
_productIndexCreator = productIndexCreator;
}
@sitereactor
sitereactor / MediaEventHandler.cs
Last active July 12, 2023 02:33
Renaming an image when its uploaded to a property with Alias "umbracoFile", but before its saved. The name of the image will be changed to the name of the folder it resides in. This is using the Saving event in the MediaService in Umbraco.
using Umbraco.Core;
using Umbraco.Core.Events;
using Umbraco.Core.IO;
using Umbraco.Core.Services;
namespace Startup
{
public class MediaEventHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
@lindstromhenrik
lindstromhenrik / gist:9779858
Last active December 2, 2016 17:03
ThenByScore-extension for EPiServer Find
public static ITypeSearch<TSource> ThenByScore<TSource>(this ITypeSearch<TSource> search)
{
return new Search<TSource, IQuery>(search, context =>
context.RequestBody.Sort.Add(new Sorting("_score")));
}
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #