Skip to content

Instantly share code, notes, and snippets.

View florisrobbemont's full-sized avatar

Floris Robbemont florisrobbemont

  • Dutch Grit
  • The Netherlands
View GitHub Profile
@florisrobbemont
florisrobbemont / function.json
Created January 10, 2020 09:43 — forked from mattbrailsford/function.json
Azure SignalR Service AutoScale Powershell Azure Function
{
"bindings": [
{
"name": "Timer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */5 * * * *"
}
]
}
@florisrobbemont
florisrobbemont / Boot code
Created June 20, 2013 10:58
Umbraco Controllers factories (IObjectFactory is a wrapper for my Windsor container. Use any other IoC technology you want)
public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
FilteredControllerFactoriesResolver.Current.InsertType<UmbracoFilteredControllerFactory>(0);
DependencyResolver.SetResolver(new WindsorDependencyResolver(Application.ObjectFactory));
GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), new WindsorCompositionRoot(Application.ObjectFactory));
}
@florisrobbemont
florisrobbemont / Domain.cs
Created March 13, 2013 20:09
Umbraco Get All Domains
/// <summary>
/// Represents a domain
/// </summary>
public class Domain
{
/// <summary>
/// Gets the unique domain id
/// </summary>
public int DomainId { get; set; }
@florisrobbemont
florisrobbemont / CreateSite.cs
Created August 24, 2012 17:03
IIS Binding from c#
// Get IIS reference (create a reference to Microsoft.Web.Administration)
ServerManager serverManager = new ServerManager();
// Create new AppPool or use existing
ApplicationPool appPool = serverManager.ApplicationPools.FirstOrDefault(x => x.Name == appPoolName);
if (appPool == null)
appPool = serverManager.ApplicationPools.Add(appPoolName);
// Umbraco is .NET 4.0
@florisrobbemont
florisrobbemont / DbSeederMigrator.cs
Created August 4, 2012 15:27
EF: Bundle Seed code with Migration classes for seeding per migration
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text.RegularExpressions;
/// <summary>
/// Provides advanced migrations by providing a seeding platform for each migration.