Skip to content

Instantly share code, notes, and snippets.

@JamesEggers1
JamesEggers1 / gist:07f931382fb66f377b0870d1a92ecb7b
Last active Apr 5, 2019
Sitecore 8.x Custom Facet Repository
View gist:07f931382fb66f377b0870d1a92ecb7b
using System;
using Sitecore.Analytics;
using Sitecore.Analytics.Model.Entities;
namespace MyNamespace.Repositories
{
public interface IPaymentFacetRepository
{
void SetFacentInformation(string userIdentifier, decimal lastPaymentAmount, DateTime lastPaymentDate);
}
@JamesEggers1
JamesEggers1 / gist:8a42c925b2909869cd71408d49057d19
Last active Apr 5, 2019
Sitecore 8.x Custom Facet Patch File
View gist:8a42c925b2909869cd71408d49057d19
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<model>
<elements>
<element interface="MyNamespace.Facet.IContactPortalInfo, MyNamespace" implementation="MyNamespace.Facet.ContactPortalInfo, MyNamespace"/>
</elements>
<entities>
<contact>
<facets>
@JamesEggers1
JamesEggers1 / gist:6bb33962d37843c182fb9f8b28e004b9
Created Apr 4, 2019
Sitecore 8.x Custom Facet Interface and Implementation
View gist:6bb33962d37843c182fb9f8b28e004b9
using Sitecore.Analytics.Model.Framework;
using System;
namespace MyNamespace.Facets
{
public interface ICustomerPaymentFacet : IFacet
{
decimal LastPaymentAmount { get; set; }
DateTime LastPaymentDate { get; set; }
}
@JamesEggers1
JamesEggers1 / gist:c6d37c2dd9d371df43787ddb54f6796e
Created Mar 19, 2019
Sitecore Patch File To Change Login Screen Background
View gist:c6d37c2dd9d371df43787ddb54f6796e
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="Login.BackgroundImageUrl">
<patch:delete />
</setting>
<setting name="Login.BackgroundImageUrl" value="/path/to/images/new_wallpaper_filename.jpg" />
</settings>
</sitecore>
</configuration>
View gist:ca214291fb3a7d2f048dd4205c321c25
background: url(/sitecore/login/drop_wallpaper.jpg) no-repeat center center fixed;
background-size: cover;
@JamesEggers1
JamesEggers1 / gist:5245252
Created Mar 26, 2013
An example of what I'd like to be able to do in Jade.
View gist:5245252
!!! 5
head
body
//- Currently this is the norm and works find
include path/to/partial
//- This is what I want to be able to do - provide the base directory from the route/rendering data.
include #{dir_from_route}/to/partial
@JamesEggers1
JamesEggers1 / timestamp.js
Created Jun 26, 2012
A simple timestamp module
View timestamp.js
module.exports = function(){
var date = new Date()
, year = date.getFullYear()
, month = date.getMonth() + 1
, day = date.getDate()
, hours = date.getHours()
, minutes = date.getMinutes()
, seconds = date.getSeconds();
if (month < 10) { month = "0" + month; }
@JamesEggers1
JamesEggers1 / Orientation.js
Created Feb 24, 2012
My Orientation Change polyfill module
View Orientation.js
var OrientationManager = (function () {
"use strict";
var supportsOrientationChange = window.hasOwnProperty("onorientationchange")
, orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"
, currentOrientation = window.orientation || 0
, currentWidth = window.outerWidth;
function orientationChanged(callBack) {
var newWidth = window.outerWidth
@JamesEggers1
JamesEggers1 / slide.js
Created Feb 23, 2012
A simple, recursive animation algorithm for scrolling an element over a certain duration.
View slide.js
function slide(element, value, duration, total) {
if (!total) { total = 0;}
if (total >= duration) {return;}
var startLocation = element.scrollLeft;
var totalDistance = Math.abs(value - startLocation);
var step = 25;
var direction = (startLocation < value) ? "left" : "right";
var iteration = duration / step;
var iterationDistance = totalDistance / iteration;
View AutoMapperIssue.cs
public class ObjectUnderTest
{
private string _prefix;
public ObjectUnderTest(string prefix)
{
_prefix = prefix;
}
public dto MapObject(obj input)