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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<httpRequestBegin> | |
<processor type="WesleyLomax.Web.Pipelines.httpRequestBegin.SetCulture, WesleyLomax.Web" patch:after="processor[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" /> | |
</httpRequestBegin> | |
</pipelines> | |
</sitecore> | |
</configuration> |
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 System.Globalization; | |
using System.Threading; | |
using System.Web.Mvc; | |
using Sitecore.Pipelines.HttpRequest; | |
namespace WesleyLomax.Web.Pipelines.httpRequestBegin | |
{ | |
public class SetCulture : HttpRequestProcessor | |
{ | |
public override void Process(HttpRequestArgs args) |
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
@Html.Glass().RenderImage(Model.CurrentLanguage, m => m.FlagIcon, new | |
{ | |
w = 20, | |
width = 20, | |
h = 15, | |
height = 15, | |
@class = "navigation-secondary__flag" | |
}, outputHeightWidth: true, isEditable: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
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" | |
staticCompressionDisableCpuUsage="95" staticCompressionEnableCpuUsage="60" | |
dynamicCompressionDisableCpuUsage="95" dynamicCompressionEnableCpuUsage="50"> | |
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" /> | |
<dynamicTypes> | |
<add mimeType="text/*" enabled="true" /> | |
<add mimeType="message/*" enabled="true" /> | |
<add mimeType="application/x-javascript" enabled="true" /> | |
<add mimeType="application/javascript" enabled="true" /> | |
<add mimeType="application/javascript; charset=utf-8" enabled="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
<!-- | |
Custom Analyzer to remove ( ) and lowercase value while maintaining a full text match no tokenizing | |
--> | |
<fieldType name="custom" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer> | |
<tokenizer class="solr.KeywordTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.PatternReplaceFilterFactory" pattern="([\(\)])" replacement="" replace="all" /> | |
</analyzer> | |
</fieldType> |
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
var jsonResult = someController.Action(); | |
// Assert | |
Assert.IsNotNull(jsonResult.Data); | |
var serializer = new JavaScriptSerializer(); | |
var result = serializer.Deserialize<Result>(serializer.Serialize(jsonResult.Data)); | |
Assert.IsTrue(result.success); |
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
[SitecoreType(AutoMap = true, TemplateId = {611933AC-CE0C-4DDC-9683-F830232DB150})] | |
public class MediaFile | |
{ | |
[SitecoreId] | |
public virtual Guid Id { get; set; } | |
[SitecoreInfo(SitecoreInfoType.Language)] | |
public virtual Language Language { get; set; } | |
[SitecoreInfo(SitecoreInfoType.Version)] |
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
private void SendEmail(string emailTo, string fromAddress, string emailSubject, string emailBody) | |
{ | |
using (var mailMessage = new MailMessage()) | |
{ | |
try | |
{ | |
mailMessage.From = new MailAddress(fromAddress); | |
mailMessage.To.Add(new MailAddress(emailTo)); | |
mailMessage.Subject = emailSubject; | |
mailMessage.Body = emailBody; |
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
# Download this file using PowerShell v3 under Windows with the following comand | |
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore | |
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
# Build results |
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
curl --request POST --silent --form "source=master" "languages=en" "http://dev/services/publish/full" |