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
@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;
}
View gist:5bc38dde86dbbec11d5f
ALTER TABLE [dbo].[cmsPropertyTypeGroup] WITH CHECK ADD CONSTRAINT [FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id] FOREIGN KEY([parentGroupId])
REFERENCES [dbo].[cmsPropertyTypeGroup] ([id])
GO
ALTER TABLE [dbo].[cmsPropertyTypeGroup] CHECK CONSTRAINT [FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id]
GO
View LetsEncrypt.ps1
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1
$domain = "mydomain.com"
$certificiatePassword = "abcd1234"
$email = "letsencrypt@mydomain.com"
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $vault
cd $vault
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/
New-ACMERegistration -Contacts mailto:$email
You can’t perform that action at this time.