Skip to content

Instantly share code, notes, and snippets.

@leekelleher
leekelleher / chocolatey.config
Created March 10, 2016 15:42
My Chocolatey package config - `choco install chocolatey.config`
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="7zip.install" />
<package id="notepadplusplus" />
<package id="googlechrome" />
<package id="skype" />
<package id="putty.install" />
<package id="kdiff3" />
<package id="gitextensions" />
<package id="windirstat" />
@leekelleher
leekelleher / our.umbraco.org.user.js
Last active February 9, 2018 11:32
Our Umbraco UserScript - declutter homepage for "power users"
// ==UserScript==
// @name Declutter Our Umbraco
// @namespace http://leekelleher.com/
// @version 0.2.9
// @description Declutters the Our Umbraco homepage, bringing focus to latest forum activity and projects
// @author Lee Kelleher
// @match https://our.umbraco.org/
// @grant none
// ==/UserScript==
@leekelleher
leekelleher / 01-umbraco-xml-cache-json-namespaced.xml
Last active March 16, 2016 10:19
Umbraco: Converting and namespacing the JSON data to XML (for use with XSLT/XPath)
<root id="-1">
<HomePage id="1234" parentID="-1" level="1" creatorID="1" sortOrder="0" createDate="2014-12-16T00:00:00" updateDate="2014-12-16T00:00:00" nodeName="Home" urlName="home" path="-1,1156" isDoc="" nodeType="1111" creatorName="admin" writerName="admin" writerID="1" template="0" nodeTypeAlias="HomePage">
<archetypeLinks><![CDATA[{"fieldsets":[{"properties":[{"alias":"linkUrl","value":"http://www.example.com/"},{"alias":"linkLabel","value":"Website"}],"alias":"externalLink","disabled":false},{"properties":[{"alias":"linkUrl","value":"http://www.example2.com/"},{"alias":"linkLabel","value":"Webshop"}],"alias":"externalLink","disabled":false}]}]]></archetypeLinks>
<json:archetypeLinks xmlns:json="http://pimpmyxslt.com/json">
<fieldsets>
<properties>
<alias>linkUrl</alias>
<value>http://www.example.com/</value>
</properties>
<properties>
@leekelleher
leekelleher / umbraco.io.user.js
Last active March 19, 2018 15:10
Umbraco Cloud UserScript - to assist with common tasks
// ==UserScript==
// @name Umbraco Cloud - UI Fixes
// @namespace http://leekelleher.com/
// @version 0.6.1
// @description Hacking around on umbraco.io
// @author Lee Kelleher
// @match https://www.umbraco.io/project/*
// @match https://www.s1.umbraco.io/project/*
// @grant none
// ==/UserScript==

The following code is intended for use as an overloaded extension for the GetPropertyValue<T>(string alias, bool recurse) method when getting strongly typed values back.

This example uses Archetype where in Umbraco v7.1.8 calling such a property value recursively returns an ArchetypeModel with 0 fieldsets.

There could be other possible applications for allowing a developer to determine the logic when GetPropertyValue(string alias, bool recurse) is trying to get a value recursively but accepts it.

@leekelleher
leekelleher / 1-README.md
Last active August 29, 2015 14:06
Ditto - Example of mapping an Archetype property to custom POCO model/type

Here is an example of using Ditto to map an Archetype property to custom POCO model/type.


Let's say that we have an Archetype to represent some SEO meta-data, and we'll call the DocType property "metaData".

We'd have 3 properties in the Archetype:

  • metaTitle
  • metaDescription
System overview
Staff, roles & responsibilities
Environments
Applications
Software Licenses
Version control
Process Flows
Documentation
Support & Maintenance
Issue Submission & Resolution
@leekelleher
leekelleher / all-html-elements.html
Created March 11, 2014 17:28
HTML element reference
<!doctype html>
<html>
<head>
<title>Test display of HTML elements</title>
</head>
<body>
<h1>Testing display of HTML elements</h1>
<h2>This is 2nd level heading</h2>
<p>This is a test paragraph.</p>
<h3>This is 3rd level heading</h3>
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Web;
using Umbraco.Web.Routing;
namespace uComponents.ContentFinders
{
public class PageNotFoundContentFinder : IContentFinder
{
@leekelleher
leekelleher / XPathDropDownListPropertyEditor.cs
Created January 16, 2014 11:13
Prototype for an Umbraco "XPath DropDownList" property editor.
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Xml;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.XPathDropDownListAlias, "XPath DropDownList", "dropdown", ValueType = "INT")]