Skip to content

Instantly share code, notes, and snippets.

Emm emmanueltissera

Block or report user

Report or block emmanueltissera

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
@emmanueltissera
emmanueltissera / DancingGoatGcp.csproj
Last active Jan 31, 2018
ASP.NET Core 2.0 Kentico Cloud app on Google Cloud Platform - A Quick How-To
View DancingGoatGcp.csproj
<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 Nov 1, 2017
Caching Dynamic Menus
View breadcrumb.html
<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 Sep 13, 2017
Generate a git patch for a specific commit
View git-apply-patch.md

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 Feb 24, 2019
Git - Applying patches to a different branch
View patchprocess.md

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 Dec 7, 2016
EmmTi.KenticoCloudConsumer.EnhancedDeliver Quick Setup
View Index.cshtml
@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 Nov 17, 2016
SuzieT.Kentico.WebApp
View ContentCache.cs
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 Dec 4, 2015
Excluding internal traffic in Google Tag Manager (resulting html when page is excluded from tracking)
View PageNotTracked.html
<!-- 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 Dec 4, 2015
Excluding internal traffic in Google Tag Manager (resulting html when page is NOT excluded from tracking)
View PageTracked.html
<!-- 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 Dec 4, 2015
Excluding internal traffic in Google Tag Manager (setting a cookie)
View IgnorePageViews.cshtml
@{
Response.Cookies["ignorePageViews"].Value = "true";
Response.Cookies["ignorePageViews"].Expires = DateTime.Now.AddYears(10);
<i>Cookie set to ignore page views.</i>
}
@emmanueltissera
emmanueltissera / HelperFunctions.cshtml
Created Dec 4, 2015
Excluding internal traffic in Google Tag Manager (HelperFunction to check exclusion)
View HelperFunctions.cshtml
@functions {
public static string TrackThisPage()
{
if (Request.QueryString["ignoreGTM"] != null && Request.QueryString["ignoreGTM"] == "false")
{
return "true";
}
else if ((Request.Cookies["ignorePageViews"] != null && Request.Cookies["ignorePageViews"].Value == "true") ||
(Request.QueryString["ignoreGTM"] != null && Request.QueryString["ignoreGTM"] == "true") ||
Request.Path.EndsWith("ignore", StringComparison.InvariantCultureIgnoreCase) ||
You can’t perform that action at this time.