Skip to content

Instantly share code, notes, and snippets.

View kgiszewski's full-sized avatar

Kevin Giszewski kgiszewski

View GitHub Profile
@kgiszewski
kgiszewski / package.manifest
Created June 20, 2018 15:18
DDL Label Template
var getDdlValue = function(selectedValue) {
return function(dataTypeResource) {
//it'd be nice to trade out the 1055 a dynamic value, but good nuff for now
return dataTypeResource.getPreValues("Umbraco.DropDown.Flexible", 1055).then(function (prevalues) {
var values = prevalues[1].value;
var actualValue = values[selectedValue[0]].value;
return actualValue;
[alias]
cleanup = !git branch --merged master | grep -v '^[ *]*master$' | xargs -r git branch -d
using Newtonsoft.Json;
namespace Models
{
public class NestedContentModel
{
//not sure if we need this
[JsonProperty("name")]
public string Name { get; set; }
@using Archetype.Models
@using Umbraco.Web
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var news = Model.Content.GetPropertyValue<ArchetypeModel>("myPropertyAlias").Take(5);
}
public static class AsyncHelper
{
private static readonly TaskFactory TaskFactory = new
TaskFactory(CancellationToken.None,
TaskCreationOptions.None,
TaskContinuationOptions.None,
TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
namespace Foo
{
@kgiszewski
kgiszewski / Its ok to...
Created November 13, 2017 13:00
It's ok to... (found posted on the door at Offroad Code)
say "I don't know"
ask for more clarity
stay at home when you feel ill
say you don't understand
ask what acronyms stand for
ask why, and why not
forget things
introduce yourself
depend on the team
ask for help
@kgiszewski
kgiszewski / app.css
Created October 20, 2017 20:10
Create a simple property editor
.sap a {
cursor: pointer;
}
@kgiszewski
kgiszewski / ExaminMunger.cs
Created October 5, 2017 20:48
Archetype Examine Indexing
using System;
using System.Text;
using Archetype.Models;
using Examine;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Logging;
namespace Demo.Core.Events
{