Skip to content

Instantly share code, notes, and snippets.

Sebastiaan Janssen nul800sebastiaan

Block or report user

Report or block nul800sebastiaan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:37dc25597a4761af4db4dd0d58f17425
Changes to the XML Schema
If you ever had to test the Document Type in XSLT, you would've probably used @nodeTypeAlias. Since the new 4.5 Schema however, this has changed.
Consider a Document Type with an alias of subPage. In the old Schema, the umbraco.config XML file would look something like:
<node id="1204" nodeTypeAlias="subPage" .... >
And in the new schema, nodeTypeAlias no longer exists but it is rather used as the actual XML node name. So it becomes:
<subPage id="1204" .....>
View CreateCertificateController.cs
using System;
using System.IO;
using System.Web.Hosting;
using System.Web.Http;
using Umbraco.Core.Logging;
using Umbraco.Web.WebApi;
namespace Cork.Core.Controllers
{
public class CertificateController : UmbracoApiController
@nul800sebastiaan
nul800sebastiaan / ~\Umbraco\Views\common\overlays\user\user.html
Created Jul 22, 2016
Fix "Link to account" button in Umbraco 7.5.0-beta / 7.5.0-beta2
View ~\Umbraco\Views\common\overlays\user\user.html
<form ng-if="login.linkedProviderKey == undefined" method="POST" name="externalLoginForm"
action="{{externalLinkLoginFormAction}}" id="oauthloginform" name="oauthloginform">
<input type="hidden" name="provider" value="{{login.authType}}" />
<button class="btn btn-block btn-social"
ng-class="login.properties.SocialStyle"
id="{{login.authType}}"
onclick="document.forms.oauthloginform.submit();">
<i class="fa" ng-class="login.properties.SocialIcon"></i>
<localize key="defaultdialogs_linkYour">Link your</localize> {{login.caption}} <localize key="defaultdialogs_account">account</localize>
@nul800sebastiaan
nul800sebastiaan / ~\Umbraco\Views\common\dialogs\user.html
Created Jul 22, 2016
Fix "Link to account" button in Umbraco 7.4.x
View ~\Umbraco\Views\common\dialogs\user.html
<form ng-if="login.linkedProviderKey == undefined" method="POST" name="externalLoginForm"
action="{{externalLinkLoginFormAction}}" id="oauthloginform" name="oauthloginform">
<input type="hidden" name="provider" value="{{login.authType}}" />
<button class="btn btn-block btn-social"
ng-class="login.properties.SocialStyle"
id="{{login.authType}}"
onclick="document.forms.oauthloginform.submit();">
<i class="fa" ng-class="login.properties.SocialIcon"></i>
Link your {{login.caption}} account
View gist:dcb2da9e664dbe17c95bac235e3f87db
using System.Linq;
using System.Web;
using ImageProcessor.Web.HttpModules;
using Umbraco.Core;
namespace MyWebsite
{
public class ImageProcessorValidation : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
View PostToUrl.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Umbraco.Forms.Core.Enums;
using System.Net;
using System.Collections.Specialized;
using Umbraco.Core.Logging;
using Umbraco.Forms.Core.Providers.Models;
View gist:6b3ede28ff5103001a74796d66bdb0a1
CREATE TABLE [cmsPreviewXml](
[nodeId] [int] NOT NULL,
[versionId] [uniqueidentifier] NOT NULL,
[timestamp] [datetime] NOT NULL,
[xml] [ntext] NOT NULL,
CONSTRAINT [PK_cmsContentPreviewXml] PRIMARY KEY CLUSTERED
(
[nodeId] ASC,
[versionId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
@nul800sebastiaan
nul800sebastiaan / gist:77f789ffa8673a0f5ace4ce577e8b9aa
Created Apr 15, 2016
Run these in src\Umbraco.Web.UI.Client
View gist:77f789ffa8673a0f5ace4ce577e8b9aa
npm install
npm install -g grunt-cli
npm install -g bower
grunt build --buildversion=7.4.3
View HaveIBeenPwndCheck.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using Newtonsoft.Json;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.HealthCheck;
View gist:0507a72e22d9c669e6c7680142fde557
public static Guid GetKey(this IPublishedContent content)
{
IPublishedContent um = content;
var wrapped = um as PublishedContentExtended;
while (wrapped != null)
wrapped = (um = wrapped.Unwrap()) as PublishedContentExtended;
var contentWithKey = um as IPublishedContentWithKey;
return contentWithKey == null ? Guid.Empty : contentWithKey.Key;
}
You can’t perform that action at this time.