Skip to content

Instantly share code, notes, and snippets.

View mattbrailsford's full-sized avatar

Matt Brailsford mattbrailsford

View GitHub Profile
+((+indexerName: DmaIndexer +__Path: \-1*\,1047\,* +__NodeTypeAlias:(dmabusiness)) (+indexerName: ExternalIndexer)) +(__nodeName:"hom"^10.0 __nodeName:(hom*)) +__IndexType:content
System.Net.WebException: The remote server returned an error: (504) Gateway Timeout.
at System.Net.HttpWebRequest.GetResponse()
at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.<>c__DisplayClass35.<RewritePath>b__32()
at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.TryFiveTimes(Action delegateAction)
at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.RewritePath(HttpContext context)
at ImageProcessor.Web.HttpModules.ImageProcessingModule.<ProcessImageAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
.btn[ng-click="preview(content)"] {
display: none !important;
}
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1laWQiOiIxMDgxIiwidW5pcXVlX25hbWUiOiJtYXR0YnJhaWxzZm9yZCIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYWNjZXNzY29udHJvbHNlcnZpY2UvMjAxMC8wNy9jbGFpbXMvaWRlbnRpdHlwcm92aWRlciI6IkFTUC5ORVQgSWRlbnRpdHkiLCJzdWIiOiJtYXR0YnJhaWxzZm9yZCIsInJvbGUiOiJ1c2VyIiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo2NTIxNCIsImF1ZCI6ImNvbnRyb2xhIiwiZXhwIjoxNDU1MDUyOTkzLCJuYmYiOjE0NTUwNTExOTN9.bO1OpOcGAXeTSYgDANqO4ruIJFnYbuW9tbZkC87SBl0
...
scope.model.config = scope.config;
...
public interface IDictionaryValueResolver
{
public string ResolveValue(string key);
}
public class ConcreteDictionaryValueResolver : IDictionaryValueResolver
{
public string ResolveValue(string key) {
// Do your thing
}
public class Bootstrap : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"].GatheringNodeData += (sender, args) =>
{
...
// Extract JSON properties
var fieldKeys = args.Fields.Keys.ToArray();
@mattbrailsford
mattbrailsford / MyContentSmellerEventHandler.cs
Created June 7, 2016 15:03 — forked from jamiepollock/MyContentSmellerEventHandler.cs
Untested example of checking what's changed between revisions of a IContent save event handler in Umbraco.
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
namespace My.App.Events
{
public class MyContentSmellerEventHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
Ditto.RegisterProcessorAttribute<Link, MultiUrlPickerAttribute>();
Ditto.RegisterProcessorAttribute<IEnumerable<Link>, MultiUrlPickerAttribute>();
SELECT [title], [created], [replies], [answer]
FROM [forumTopics]
WHERE [created] BETWEEN '2015-08-01 00:00:00' AND '2016-07-31 23:59:59'
AND [isSpam] = 0