Skip to content

Instantly share code, notes, and snippets.


Kim Gunnarsson kimgunnarsson

View GitHub Profile
kimgunnarsson / FindProperty.cs
Last active Aug 29, 2015
Code for using page properties as Dynamic Properties in EPiServer and retrieve their values up the chain. Code is provided as is. If you use it, you might consider doing some nice null- and empty checks.
View FindProperty.cs
using EPiServer;
using EPiServer.Core;
using EPiServer.ServiceLocation;
namespace Core.Properties
public static class PropertyFinder
public static T FindProperty<T>(PageData currentPage, string propertyName)
View .gitconfig
co = checkout
ci = commit
st = status
log1 = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lg1 = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
exclude = !sh -c 'echo "$1" >> .git/info/exclude'
kimgunnarsson / PageDataUIDescriptor.cs
Created Jan 9, 2015
EPiServer UI Descriptor to set DefaultView to All Properties View
View PageDataUIDescriptor.cs
using EPiServer.Shell;
namespace Meridium.UIDescriptors
public class PageDataUIDescriptor: UIDescriptor<PageData>
public BasePageUIDescriptor()
DefaultView = CmsViewNames.AllPropertiesView;
View staticserver.js
var express = require("express"),
open = require('open'),
app = express(),
host = 'ENTER HOST IP';
if(process.argv.length > 2) {
port = parseInt(process.argv[2]);
View EPiServer.EmbeddedLangFiles.language_EN.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language name="English" id="en">
View PreDeploy.ps1
Import-Module WebAdministration
if($SiteNamesForDeploy) {
$sitesForDeploy = $SiteNamesForDeploy.Split(',')
for ($i=0; $i -lt $sitesForDeploy.length; $i++) {
$currentSite = $sitesForDeploy[$i].Trim()
Write-Output "Stop-Website $currentSite"
kimgunnarsson / index.html
Created Nov 18, 2015 — forked from twalther/index.html
View index.html
<!doctype html>
<title>Meridium blogginlägg</title>
body {
font-family: 'Nunito', HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 300;
kimgunnarsson / CustomSelectionFactory.cs
Last active Dec 20, 2015
Custom SelectionFactory with generic EditorDescriptor
View CustomSelectionFactory.cs
using System;
using System.Collections.Generic;
using System.Linq;
using EPiServer.Shell.ObjectEditing;
namespace Alloy.Business.Properties.CustomSelectionFactory
class CustomSelectionFactory<T> : ISelectionFactory
public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
View SelectionEditor.js
// Dojo
// EPi
// Resources
View ConfigurableUnifiedSearchFor.Overload.cs
public static IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language)
return ConfigurableUnifiedSearchFor(client, query, language, DefaultOperator.OR);