Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Kim Gunnarsson kimgunnarsson

:shipit:
View GitHub Profile
@kimgunnarsson
kimgunnarsson / EpiServer.UpdateModifiedDate.cs
Created Apr 28, 2016
Episerver: Update Modified Date for Usages of specific PageType
View EpiServer.UpdateModifiedDate.cs
var contentRepo = ServiceLocator.Current.GetInstance<IContentRepository>();
var contentTypeRepo = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
var contentType = contentTypeRepo.Load(typeof (PageData));
var usageRepo =
ServiceLocator.Current.GetInstance<IContentModelUsage>()
.ListContentOfContentType(contentType)
.Select(x => x.ContentLink.ToReferenceWithoutVersion()).Distinct()
.ToList();
@kimgunnarsson
kimgunnarsson / git-imperative-log.md
Created Apr 20, 2019
Git log format for imperative sentence checking
View git-imperative-log.md

Will format output of git log in the form of imperative sentences.

git log --format=%s --line-prefix="If applied, this commit will "

Example:

If applied, this commit will Reduce load on Spinnaker
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.min.js"></script>
</head>
@kimgunnarsson
kimgunnarsson / EPiServer.Forms_SV.xml
Created Mar 15, 2016
Episerver Forms Translations
View EPiServer.Forms_SV.xml
<?xml version="1.0" encoding="utf-8" ?>
<languages>
<language name="Svenska" id="sv">
<episerver>
<forms>
<contenttypescomponent>
<title>Formulärelement</title>
<description>Visa alla innehållstyper från EPiServer forms</description>
</contenttypescomponent>
<formscomponent>
View ConfigurableUnifiedSearchFor.Overload.cs
public static IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language)
{
return ConfigurableUnifiedSearchFor(client, query, language, DefaultOperator.OR);
}
View SelectionEditor.js
define([
// Dojo
"dojo/_base/declare",
"dojo/_base/array",
"dojox/html/entities",
// EPi
"epi-cms/contentediting/editors/SelectionEditor",
// Resources
"epi/i18n!epi/cms/nls/episerver.cms.widget.contentselector"],
@kimgunnarsson
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)
@kimgunnarsson
kimgunnarsson / index.html
Created Nov 18, 2015 — forked from twalther/index.html
webos-blogpost
View index.html
<!doctype html>
<html>
<head>
<title>Meridium blogginlägg</title>
<style>
body {
font-family: 'Nunito', HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 300;
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"
View EPiServer.EmbeddedLangFiles.language_EN.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<languages>
<language name="English" id="en">
<admin>
<categories>
<tabledescription>Description</tabledescription>
</categories>
</admin>
</language>
</languages>