Skip to content

Instantly share code, notes, and snippets.

@MarcStoecker
MarcStoecker / umbraco-forms-newsletteroptin.xslt
Created November 30, 2016 11:06
A template for email opt-in mails (XSLT) for Umbraco Forms
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:my-scripts"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="xsl msxsl user umbraco.library">
<xsl:output method="html" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="DTD/xhtml1-strict.dtd"
F - Browse Name
: - Edit in Canvas
C - Create
5 - Send to translation
4 - Translate
Z - Audit Trail
D - Delete
M - Move
O - Copy
S - Sort
@MarcStoecker
MarcStoecker / umbraco-gallery.js
Created August 21, 2014 17:27
SirTrevor for Umbraco: Gallery Hotfix
<rules>
<rule name="SimpleCanonicalHostNameRule">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" />
</rule>
@MarcStoecker
MarcStoecker / cyrillic -transliteration--umbracoSettings.config.xml
Last active March 15, 2017 15:59
Umbraco: Transliterating cyrillic URLs with umbracoSettings.config
<!--
www.mindrevolution.com
ENGINEERED IN STUTTGART.
While modern systems (on server and client side) work quite well with non-latin (UTF-8) URLs,
they still present some technical risk. Transliteration of cyrillic URLs to their latin
representation can be accomplished quite easily with the standard Umbraco URL replacing
in "umbracoSettings.config" (in directory "/config/").
It is not possible to account for some of the finer details, but using a simple replacement
@MarcStoecker
MarcStoecker / foldersize.ps1
Created March 7, 2013 16:36
Display Total Folder Size with PowerShell and Sort by Size (can take a while if many levels to work down to)
ls -Force | Add-Member -Force -Passthru -Type ScriptProperty -Name Length -Value {ls $this -Recurse -Force | Measure -Sum Length | Select -Expand Sum } | Sort-Object Length -Descending | Format-Table @{label="TotalSize (MB)";expression={[Math]::Truncate($_.Length / 1MB)};width=14}, @{label="Mode";expression={$_.Mode};width=8}, Name
@MarcStoecker
MarcStoecker / javascript.js
Created October 1, 2012 14:20
simple umbraco GA tracking (concept/mockup)
$(function() {
var foo = "";
$("body").find("[data-tracking=='']").each(function(index) {
if ($(this).data("tracking")!='')
{
var trackingTokens = $(this).data("tracking").split(",");
$(this).click(function() {
_gaq.push(["_trackEvent", trackingTokens[0], trackingTokens[1], trackingTokens[2]]);
});
@MarcStoecker
MarcStoecker / gist:3498825
Created August 28, 2012 15:00
Crossdomain file for Pixlr
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.pixlr.com" />
<site-control permitted-cross-domain-policies="master-only"/>
<allow-http-request-headers-from domain="*.pixlr.com" headers="*" secure="true"/>
</cross-domain-policy>
@MarcStoecker
MarcStoecker / gist:3101167
Created July 12, 2012 21:31
Rewrite DAMP's (DigibizAdvancedMediaPicker for Umbraco) backend thumbnail requests to use ImageResizer for lightning fast resize and effective disk caching
<system.webServer>
<!-- IIS rewrite module 2.0 -->
<rewrite>
<rules>
<!-- Umbraco backend: merge DAMP with ImageResizer.Net -->
<!-- Rewrite DAMP's (DigibizAdvancedMediaPicker for Umbraco) backend thumbnail requests to use ImageResizer -->
<!-- for lightning fast resize and effective disk caching -->
<rule name="DAMP">
<match url="^umbraco/plugins/DigibizAdvancedMediaPicker/DAMP_ImagePreview\.ashx" />
<conditions trackAllCaptures="true">