This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceConfiguration(typeof(IPropertyConverterProvider), Lifecycle = ServiceInstanceScope.Singleton)] | |
public class CustomPropertyConverterProvider : IPropertyConverterProvider | |
{ | |
public int SortOrder => 200; | |
public IPropertyConverter Resolve(PropertyData propertyData) | |
{ | |
if (propertyData is PropertyContentArea) | |
{ | |
return new PersonalizedContentAreaPropertyConverter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.ApplicationInsights.Extensibility; | |
using Microsoft.ApplicationInsights.Extensibility.Implementation; | |
public class Startup | |
{ | |
public void Configure(TelemetryConfiguration telemetryConfiguration) | |
{ | |
telemetryConfiguration.DisableTelemetry = true; | |
TelemetryDebugWriter.IsTracingDisabled = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using EPiServer.ServiceLocation; | |
using Microsoft.AspNetCore.Mvc; | |
using Optimizely.ContentGraph.Cms.Core.Internal; | |
namespace DeaneBarker.Optimizely.Cms | |
{ | |
[Route("component")] | |
public class ComponentController : Controller | |
{ | |
private const string KEY_TOKEN = "@key"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<table-of-contents title="Contents" source=".article" selector="h2,h3"></table-of-contents> | |
* "title" will be placed in a HEADER tag as the first child | |
* "source" default to the BODY tag | |
* "selector" defaults to "h2" | |
OR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<relative-date datetime="1971-09-03" prefix="Posted" suffix="ago"/> | |
Outputs: | |
<relative-date>Posted 52 years ago</relative-date> | |
*? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to a permanent repo here: https://github.com/deanebarker/Nemmet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file is just for naming |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UIDescriptorRegistration] | |
public class HideVisualViewUIDescriptor : UIDescriptor<[Page Type or interface> | |
{ | |
public HideVisualViewUIDescriptor() : base() | |
{ | |
DefaultView = CmsViewNames.AllPropertiesView; | |
EnableStickyView = false; | |
DisabledViews = new[] { CmsViewNames.PreviewView, CmsViewNames.OnPageEditView }; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// This code depends on the FlatFiles Nuget package: https://github.com/jehugaleahsa/FlatFiles | |
// Download the dataset from here: https://view.data.post45.org/nytfull | |
var pathToFile = @"[path to file]"; | |
var mapper = DelimitedTypeMapper.Define<BookRanking>(); | |
mapper.Property(c => c.Year).ColumnName("year"); | |
mapper.Property(c => c.Week).ColumnName("week").InputFormat("yyyy-MM-dd"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is some rough/stub code for extracting raw text from a Word document | |
// A modern Word document (.docx) is just a zip file. Extract it. | |
// Find a file called word/document.xml. That contains the text of the document. | |
// Paragraphs are in "w:p" tags, and text is in "w:t". | |
// Iterate the "p" tags, then concatenate all the "t" tags inside them | |
void Main() | |
{ | |
var doc = XDocument.Parse(File.ReadAllText(" [path to word/document.xml] ")); | |
XNamespace nsW = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"; |
NewerOlder