Skip to content

Instantly share code, notes, and snippets.

@robgha01
robgha01 / AssemblyInfo.cs
Last active October 1, 2019 09:26
Cake AssemblyInfo Code
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Cake.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
using System.Runtime.InteropServices;
using System;
using BlueLeet.Core.Attributes;
Preparing to run build script...
Running build script...
Module directory does not exist.
Analyzing build script...
Analyzing D:/Workspaces/BlueLeet/Websites/ReproProject/Build/ReproProject.UI.cake...
Processing build script...
Creating script session...
Using prerelease build of Roslyn.
Adding reference to mscorlib.dll...
Adding reference to System.Core.dll...
<template #DefaultTemplate>
<inline-editor-group [openInModal]="true" (onSave)="this.doSave()" (onCancel)="this.doCancel()" [(disableSave)]="this?.profileForm.invalid || !this?.profileForm.dirty">
<form class="form-horizontal" [formGroup]="profileForm">
<inline-text-editor formControlName="name" [focusThis]="true" type="text" name="Namn">
<presentation-state>
<template let-editor>
<div>
<i class="fa fa-user" aria-hidden="true"></i> namn
</div>
<p>{{ editor?.value }}</p>
@robgha01
robgha01 / ContentExtensions.cs
Created February 11, 2017 15:06 — forked from jbreuer/ContentExtensions.cs
An extension method to convert an IContent to an IPublishedContent.
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContentExtensions.cs" company="Colours B.V.">
// © Colours B.V. 2015
// </copyright>
// <summary>
// The content extensions.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Project.Web.Core.Extensions
@robgha01
robgha01 / FileUploadApiController.cs
Created February 6, 2017 14:11 — forked from cssquirrel/FileUploadApiController.cs
Using AngularJS API service and Umbraco API controller to permit users to upload files to the server
// Use whatever namespacing works for your project.
namespace YourSite.Web.Controllers.Api
{
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@robgha01
robgha01 / DocumentTypeRouteConstraint.cs
Created January 14, 2017 13:12
Umbraco 7 Custom route with UmbracoVirtualNodeRouteHandler
public class DocumentTypeRouteConstraint : IRouteConstraint
{
private readonly MatchFunc match;
public DocumentTypeRouteConstraint(string documentTypeAlias, MatchFunc match = null)
{
this.match = match;
DocumentTypeAlias = documentTypeAlias;
}
@robgha01
robgha01 / Bootstrap.cs
Last active January 13, 2017 21:16
Umbraco 7 How to create a custom route.
public class ApplicationRouteBootstrap : ApplicationEventHandler
{
/// <inheritdoc />
protected override void ApplicationStarted(
UmbracoApplicationBase umbracoApplication,
ApplicationContext applicationContext)
{
RouteTable.Routes.MapUmbracoRoute(
"Profile",
"{action}/{alias}",
@robgha01
robgha01 / gh-pages-deploy.md
Created October 31, 2016 11:41 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

using System;
using System.Collections.Generic;
using System.Linq;
using Cake.Core;
using Cake.Core.Annotations;
using JetBrains.Annotations;
/// <summary>
Preparing to run build script...
Clearing NuGet HTTP cache: C:\Users\Robert\AppData\Local\NuGet\v3-cache
Clearing NuGet cache: C:\Users\Robert\AppData\Local\NuGet\Cache
Clearing NuGet global packages cache: C:\Users\Robert\.nuget\packages\
Local resources cleared.
Running build script...
Module directory does not exist.
Performing debug...
Attach debugger to process 6580 to continue
Debugger attached