Skip to content

Instantly share code, notes, and snippets.

View emmanueltissera's full-sized avatar

Emm emmanueltissera

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / restore-database.sql
Last active April 19, 2016 10:28
Generic T-SQL for restoring a database from a backup
-- INSTRUCTIONS:
-- 1. Replace custom_database with the actual database name (Use a replace all on custom_database)
-- 2. Change @BackUpFileName to the actual location
-- 3. Change parameters for @DbUser & @LoginPassword
-- ============================
-- Restore [custom_database]
-- ============================
DECLARE @BackUpFileName varchar(100), @DbUser varchar(100), @LoginPassword varchar(100);
@emmanueltissera
emmanueltissera / Transact SQL for SQL 2008 and above
Created July 1, 2013 14:56
Transact SQL for SQL 2008 and above to work with a integer array like structure
ALTER PROCEDURE getNodes
@isActive bit
AS
BEGIN
-- Declare a single column table to be used as a single dimension array
DECLARE @activeNodes TABLE (id int)
-- Only if the following condition is satisfied, 1070 will be added to the pseudo-array
IF @isActive = 1
INSERT INTO @activeNodes(id) VALUES (1070)
@emmanueltissera
emmanueltissera / Transact SQL for SQL 2005
Created July 1, 2013 14:54
Transact SQL for SQL 2005 to work with a integer array like structure
CREATE PROCEDURE getNodes
@isActive bit
AS
BEGIN
-- Declare a single column table to be used as a single dimension array
DECLARE @activeNodes TABLE (id int)
-- Only if the following condition is satisfied, 1070 will be added to the pseudo-array
IF @isActive = 1
INSERT INTO @activeNodes(id) VALUES (1070)