Skip to content

Instantly share code, notes, and snippets.

View kimgunnarsson's full-sized avatar
:shipit:

Kim Gunnarsson kimgunnarsson

:shipit:
View GitHub Profile
@kimgunnarsson
kimgunnarsson / staticserver.js
Created January 28, 2015 21:00
staticserver.js
var express = require("express"),
open = require('open'),
app = express(),
port = ENTERPORT,
host = 'ENTER HOST IP';
if(process.argv.length > 2) {
port = parseInt(process.argv[2]);
}
@kimgunnarsson
kimgunnarsson / PageDataUIDescriptor.cs
Created January 9, 2015 14:47
EPiServer UI Descriptor to set DefaultView to All Properties View
using EPiServer.Shell;
namespace Meridium.UIDescriptors
{
[UIDescriptorRegistration]
public class PageDataUIDescriptor: UIDescriptor<PageData>
{
public BasePageUIDescriptor()
{
DefaultView = CmsViewNames.AllPropertiesView;
@kimgunnarsson
kimgunnarsson / .gitconfig
Last active August 29, 2015 14:02
Alias config
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
kimgunnarsson / FindProperty.cs
Last active August 29, 2015 14:02
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.
using EPiServer;
using EPiServer.Core;
using EPiServer.ServiceLocation;
namespace Core.Properties
{
public static class PropertyFinder
{
public static T FindProperty<T>(PageData currentPage, string propertyName)