Skip to content

Instantly share code, notes, and snippets.

View ismailmayat's full-sized avatar

Ismail Mayat ismailmayat

View GitHub Profile
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text.RegularExpressions;
using Moq;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web;
using Umbraco.ModelsBuilder;
using System.IO;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace MendozaDM.Core.Helpers
{
public static class TransformationHelper
{
/// <summary>
@sskoopa
sskoopa / docker-run-redis.md
Created January 9, 2017 21:41
Start redis in Docker with a open port at localhost:6379

docker run --name recorder-redis -p 6379:6379 -d redis:alpine

@abjerner
abjerner / ExaminePublishedContent.cs
Created October 11, 2016 21:17
Convert SearchResult into IPublishedContent
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Examine;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
namespace Skybrud.ExamineDevStuff {
@jbreuer
jbreuer / gist:0a5996e5e6bf881ce847
Last active December 31, 2018 05:24
Archetype and Nested Content as Models Builder properties
[ImplementPropertyType("slider")]
public IEnumerable<HomeSlider> Slider
{
get
{
var archetypeModel = this.GetPropertyValue<ArchetypeModel>("slider");
return archetypeModel.Select(x =>
{
return new HomeSlider()
{
@nul800sebastiaan
nul800sebastiaan / ShowOrderForm.cshtml
Last active July 15, 2019 01:05
ShowOrderForm.cshtml
@using Awesome.FormDemo.Controllers
@model Awesome.FormDemo.Models.TicketOrderModel
@if (TempData.ContainsKey("CustomMessage"))
{
<div>Hooray! - @TempData["CustomMessage"]</div>
}
else
{
using (Html.BeginUmbracoForm<TicketOrderController>("FormSubmit"))
@joeriks
joeriks / ArticlePageViewModel.cs
Last active March 8, 2021 08:14
PartialFor - resolve name of partial from type name or from UIHint (like DisplayFor)
public class ArticlePageViewModel {
// use partial view "TopMenuViewModel.cshtml"
public TopMenuViewModel TopMenu {get;set;}
// use partial view "WidgetsViewModel.cshtml"
public WidgetsViewModel Widgets {get;set;}
// use partial view "ExtraWidgets.cshtml"
[UIHint("ExtraWidgets")]
@joeriks
joeriks / json.master
Last active January 17, 2017 00:47
Umbraco Content as Json (alttemplate=json or alttemplate=json&includeChildren=1 or alttemplate=json&includeAllChildren=1) for Umbraco v 4
<%@ Master Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="umbraco" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
var createdObject = nodeObject(umbraco.NodeFactory.Node.getCurrentNodeId(), Request["includeChildren"] != null, Request["includeAllChildren"] != null);
@uniquelau
uniquelau / createWebsite.ps1
Last active December 17, 2015 10:09
Powershell file that makes creating new websites in IIS a breeze! :) $InetFolder & $Domain should be tweaked for your purposes. Original code from http://www.zerrouki.com/create-website/ + added in multiple hostnames, fixed Runtime bug. Now supports creation of a single Virtual Directory, e.g. for Media in a load balanced environment.
<#
.SYNOPSIS CreateWebsite - Automatic website creation.
.DESCRIPTION Allow to create a website and its ApplicationPool. Some tuning is included
.PARAMETER SiteName Defines the display name (in IIS Manager) of the website
Mandatory parameter.
.PARAMETER Port Defines the listening port for the website
Default is "80".
.PARAMETER Environment Defines the website environment.
This will be added as suffix in the website display name
Possible values are "LIVE", "STAGING", "UAT", "QUAL" or "DEV"