Skip to content

Instantly share code, notes, and snippets.

View lars-erik's full-sized avatar

Lars-Erik Aabech lars-erik

View GitHub Profile
@lars-erik
lars-erik / Upload media to Azure.cs
Created February 12, 2014 15:39
Move Umbraco media to Azure
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
namespace MediaToAzure
{
@lars-erik
lars-erik / Highlighting.cs
Created November 26, 2014 23:34
Highlighting Lucene Wildcard Queries
using System;
using Lucene.Net.Analysis.Snowball;
using Lucene.Net.Documents;
using Lucene.Net.Highlight;
using Lucene.Net.Index;
using Lucene.Net.Search;
using Lucene.Net.Store;
using NUnit.Framework;
namespace Lucene.Experiments.Tests
@lars-erik
lars-erik / external tool
Created December 19, 2014 16:32
VS GIT Merge modified with commited
Title: Merge with unmodified
Command: [path to bat file]
Arguments: "%(ItemDir)" "$(ItemFilename)" "$(ItemExt)"
Initial dir: "$(ItemDir)"
Use output window
Don't prompt for args
Don't treat as unicode
Close on exit (disabled true)
@lars-erik
lars-erik / .gitconfig
Last active October 12, 2015 13:35 — forked from milas/.gitconfig
Updated to VS 2013
[diff]
tool = vsdiffmerge
guitool = vsdiffmerge
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = \"C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" /t
keepbackup = false
trustexistcode = true
@lars-erik
lars-erik / UmbracoFormsExtensionsController.cs
Created June 2, 2016 08:05
Conditional pages for Umbraco Forms
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Forms.Core;
using Umbraco.Forms.Mvc.Models;
using Umbraco.Forms.Web.Controllers;
namespace UmbForms.Extensions
{
public class UmbracoFormsExtController : UmbracoFormsController
@lars-erik
lars-erik / UmbracoSupport.cs
Created March 18, 2017 22:16
Simple support class for using Umbraco.Tests unobtrusively
using System;
using System.Globalization;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Moq;
using Umbraco.Core;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
@lars-erik
lars-erik / list-parameters.component.ts
Created July 11, 2018 09:39
Failing entry component
@Component({
selector: "list-parameters",
templateUrl: "./list-parameters.html"
})
export class ListParametersComponent {
@Input()
public query: any = {};
@Output()
queryChange = new EventEmitter();
@lars-erik
lars-erik / Fake_Json.test.cs
Created September 28, 2018 14:16
Fake JSON API in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.Owin.Hosting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@lars-erik
lars-erik / FancyHomeController.cs
Last active January 18, 2019 08:45
Making strings something readable and valuable automagically
using System;
using System.ComponentModel;
using System.Globalization;
using System.Web.Mvc;
using Microsoft.Ajax.Utilities;
namespace StringTypes.Web.Controllers
{
public class HomeController : Controller
{
@lars-erik
lars-erik / CompositeCommands.cs
Created February 13, 2019 21:26
Simple but flexible command handling
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace SimpleCommands.Tests
{
[TestFixture]
public class When_Processing_A_Command_With_A_Composite
{