Skip to content

Instantly share code, notes, and snippets.

@Jeavon
Jeavon / gist:7111b5443c671e738bdb
Created November 20, 2015 13:09
umbOktoberfest
"%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe" -ssadd -d umbOktoberFest2015SessionState -S <SQLServer\Instance> -U <SQLUser> -P <SQLPassword> –sstype c
<sessionState allowCustomSqlDatabase="true" cookieless="UseCookies" mode="SQLServer" sqlConnectionString="server=<SQLServer\Instance>;database=umbOktoberFest2015SessionState;user id=<SQLUser>;password=<SQLPassword>" timeout="43200" />
@Jeavon
Jeavon / RteCustomValueConverter.cs
Created May 13, 2015 21:31
Umbraco RteCustomValueConverter to output data-rel attributes on images
namespace MyProject.ValueConverters
{
using System.Linq;
using System.Web;
using HtmlAgilityPack;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.ValueConverters;
@Jeavon
Jeavon / gist:be9f8ca38cf8996ffede
Created April 30, 2015 19:33
ConfigDurationOutputCacheAttribute.cs
namespace MyProj.Common.Cache
{
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.UI;b
using DevTrends.MvcDonutCaching;
public class ConfigDurationOutputCacheAttribute : DonutOutputCacheAttribute
{
angular
.module('umbraco')
.controller("nuPickers.Shared.TypeaheadListPicker.TypeaheadListPickerEditorController",
['$scope',
function ($scope) {
alert('hi');
//$scope.clear = function () {
// $scope.typeahead = null;
@Jeavon
Jeavon / slimsy.cshtml
Last active March 3, 2016 12:10
Slimsy Pad
@using Umbraco.Web.Models
@Model.Content.GetCropUrl(100, 200, "myContentCropperPropertyAlias", quality: 90, imageCropMode: ImageCropMode.Pad, ratioMode: ImageCropRatioMode.Height, furtherOptions: "&slimmage=true")
@Jeavon
Jeavon / MyStuff.cs
Created October 31, 2014 18:36
Wrapper for GetCropUrl to set default bgColor
namespace MyStuff.App_Code
{
using Umbraco.Core.Models;
using Umbraco.Web;
public static class MyHelpers
{
public static string MyGetCropUrl(this IPublishedContent publishedContent, int width, int height)
{
var bgColor = "fff";
@Jeavon
Jeavon / gist:f50957baa96906a7e59c
Created October 30, 2014 20:00
Bind PVC by DataTypeId
public bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.DataTypeId == 1234;
}
@Jeavon
Jeavon / RteCustomValueConverter.cs
Created September 30, 2014 09:41
Remove invalid rel tags from RTE images on render
namespace Crumpled.Logic.ValueConverters
{
using System.Linq;
using System.Web;
using HtmlAgilityPack;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.ValueConverters;
@Jeavon
Jeavon / Custom-2Col.css
Created September 10, 2014 16:15
Custom 2Col RTE Archetype Stylesheet
.archetypeEditor div.archetypeProperty {
float: left;
clear: none;
margin-left: 20px;
}
.archetypeEditor div.archetypeProperty:first-child {
margin-left: 0;
}
@Jeavon
Jeavon / web.config
Last active August 29, 2015 14:06
Exclude Umbraco from IIS compression to avoid View load failure
<location path="umbraco">
<system.webServer>
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
</system.webServer>
</location>
<location path="App_Plugins">
<system.webServer>
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
</system.webServer>
</location>