Skip to content

Instantly share code, notes, and snippets.

View emmanueltissera's full-sized avatar

Emm emmanueltissera

View GitHub Profile
@emmanueltissera
emmanueltissera / create-umbraco-v9-demo.sh
Created November 22, 2021 20:58
Unattended Azure deployment of Umbraco v9
# Set variables
echo UMBRACO 9 DEMO INSTALL
demoNameDefault='umbracov9-demo-'$RANDOM
# Get the demo name from the user
echo
echo Demo name should be only contain alphanumerics and hyphens. It Can''t start or end with hyphen. It should be less than 15 characters in length and globally unique. This will be the name of your web app.
read -p "Enter demo name [$demoNameDefault]: " input
demoName="${input:-$demoNameDefault}"
echo Demo Name: $demoName
@emmanueltissera
emmanueltissera / DancingGoatGcp.csproj
Last active January 31, 2018 11:21
ASP.NET Core 2.0 Kentico Cloud app on Google Cloud Platform - A Quick How-To
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<UserSecretsId>DancingGoatGcp</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
<PackageReference Include="KenticoCloud.Delivery" Version="4.12.0" />
@emmanueltissera
emmanueltissera / breadcrumb.html
Last active August 30, 2021 08:53
Caching Dynamic Menus
<ol class="breadcrumb">
<li data-id="1076"><a href="/" title="Home">Home</a></li>
<li data-id="1122"><a href="/community/" title="Community">Community</a></li>
<li class="active" data-id="1123">News</li>
</ol>
@emmanueltissera
emmanueltissera / git-apply-patch.md
Created September 13, 2017 02:34
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

@emmanueltissera
emmanueltissera / patchprocess.md
Last active February 2, 2023 12:14
Git - Applying patches to a different branch

Applying Patches to a different branch

Creating the patch

git format-patch -1 HEAD

OR

git format-patch -1 <SHA>

Applying the patch:

@emmanueltissera
emmanueltissera / Index.cshtml
Last active December 7, 2016 08:32
EmmTi.KenticoCloudConsumer.EnhancedDeliver Quick Setup
@model EmmTi.KenticoCloudConsumer.EnhancedDeliver.Sample.Models.SampleViewModel
<div class="article-tile article-tile-large">
<div class="col-md-12 col-lg-6">
<a href="@Url.Action("Show", "Articles", new { id = Model.System.Codename })">
<img src="@Model.TeaserImage.Url" class="article-tile-image" alt="@Model.System.Name" />
</a>
</div>
<div class="col-md-12 col-lg-6">
<div class="article-tile-date">
@emmanueltissera
emmanueltissera / ContentCache.cs
Last active November 17, 2016 19:29
SuzieT.Kentico.WebApp
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Runtime.Caching;
using System.Web;
using SuzieT.Kentico.WebApp.Interfaces;
namespace SuzieT.Kentico.WebApp.Helpers
{
@emmanueltissera
emmanueltissera / PageNotTracked.html
Created December 4, 2015 10:58
Excluding internal traffic in Google Tag Manager (resulting html when page is excluded from tracking)
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>dataLayer = [{'trackThisPage': 'false'}];
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->
@emmanueltissera
emmanueltissera / PageTracked.html
Created December 4, 2015 10:57
Excluding internal traffic in Google Tag Manager (resulting html when page is NOT excluded from tracking)
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>dataLayer = [{'trackThisPage': 'true'}];
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->
@emmanueltissera
emmanueltissera / IgnorePageViews.cshtml
Created December 4, 2015 10:56
Excluding internal traffic in Google Tag Manager (setting a cookie)
@{
Response.Cookies["ignorePageViews"].Value = "true";
Response.Cookies["ignorePageViews"].Expires = DateTime.Now.AddYears(10);
<i>Cookie set to ignore page views.</i>
}