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 / git-imperative-log.md
Created April 20, 2019 15:23
Git log format for imperative sentence checking

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
<!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.UpdateModifiedDate.cs
Created April 28, 2016 07:32
Episerver: Update Modified Date for Usages of specific PageType
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 / EPiServer.Forms_SV.xml
Created March 15, 2016 09:43
Episerver Forms Translations
<?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>
@kimgunnarsson
kimgunnarsson / ConfigurableUnifiedSearchFor.Overload.cs
Last active February 17, 2016 21:22
ConfigurableUnifiedSearchFor
public static IQueriedSearch<ISearchContent, QueryStringQuery> ConfigurableUnifiedSearchFor(this IClient client, string query, Language language)
{
return ConfigurableUnifiedSearchFor(client, query, language, DefaultOperator.OR);
}
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 December 20, 2015 20:35
Custom SelectionFactory with generic EditorDescriptor
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 November 18, 2015 07:44 — forked from twalther/index.html
webos-blogpost
<!doctype html>
<html>
<head>
<title>Meridium blogginlägg</title>
<style>
body {
font-family: 'Nunito', HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 300;
@kimgunnarsson
kimgunnarsson / PreDeploy.ps1
Created October 7, 2015 17:32
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"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<languages>
<language name="English" id="en">
<admin>
<categories>
<tabledescription>Description</tabledescription>
</categories>
</admin>
</language>
</languages>