Skip to content

Instantly share code, notes, and snippets.

View dburriss's full-sized avatar

Devon Burriss dburriss

View GitHub Profile
@dburriss
dburriss / Publish.ps1
Created September 9, 2015 20:29
Powershell script for publishing AP.NET 5 DNX based project for Azure
Param(
[Parameter(Mandatory = $true)]
[string]$sourceDir,
[string]$branch = "master"
)
# bootstrap DNVM into this session.
&{$branch;iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
# load up the global.json so we can find the DNX version
@dburriss
dburriss / global.json
Last active September 10, 2015 05:26
A global.json ASP.NET 5 file with a runtime property
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7",
"runtime": "clr"
}
}
@dburriss
dburriss / kuduSiteUpload.ps1
Last active September 17, 2015 06:19 — forked from davideicardi/kuduSiteUpload.ps1
Upload a local directory to an Azure Website using kudu and powershell
Param(
[Parameter(Mandatory = $true)]
[string]$websiteName,
[Parameter(Mandatory = $true)]
[string]$sourceDir,
[string]$destinationPath = "/site/wwwroot"
)
# Usage: .\kuduSiteUpload.ps1 -websiteName mySite -sourceDir C:\Temp\mydir
@dburriss
dburriss / NoNullString.cs
Last active November 6, 2021 09:26
Code required to create a model binder that sets or empty or no strings to empty string during binding
//In Startup.cs file
services.AddMvc(config =>
config.ModelBinderProviders.Insert(0, new NoNullStringModelBinderProvider())
);
//model binder provider
public class NoNullStringModelBinderProvider : IModelBinderProvider
{
public IModelBinder GetBinder(ModelBinderProviderContext context)
{
@dburriss
dburriss / pretzel.cake
Last active March 19, 2017 22:16
A Cake build script for building Pretzel static content
var target = Argument("target", "Default");
var configuration = Argument("Configuration", "Release");
var port = Argument("Port", "5001");
var installDirectory = "C:\\ProgramData\\chocolatey\\lib\\pretzel\\tools";
var pretzelExe = installDirectory + "\\Pretzel.exe";
public static void Replace(string file, string @this, string withThis)
{
var config = System.IO.File.ReadAllText(file, Encoding.UTF8);
@dburriss
dburriss / appveyor.yml
Last active January 31, 2017 23:13
Pretzel AppVeyor build and deployment to blog
branches:
only:
- source
environment:
access_token:
secure: ABC123...
# replace the above with your secure token
install:
@dburriss
dburriss / FactResharper
Created June 28, 2017 05:40
An XUnit fact snippet for Resharper.
[Fact]
public void $Unit$_$Scenario$_$Expected$()
{
$END$
}
@dburriss
dburriss / FactResharper
Created June 28, 2017 05:42
An XUnit fact snippet for Resharper. Go to Resharper >> Tools >> Templates Explorer. Put under C#.
[Fact]
public void $Unit$_$Scenario$_$Expected$()
{
$END$
}
@dburriss
dburriss / fact.snippet
Created June 28, 2017 06:08
An XUnit fact snippet for Visual Studio. Navigate to Tool > Code Snippets Manager... (or press Ctrl+K, Ctrl+B)
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>XUnit Fact method</Title>
<Author>Devon Burriss</Author>
<Description>Creates a method that will run as an XUnit test (fact).</Description>
<Shortcut>fact</Shortcut>
</Header>
@dburriss
dburriss / create-solution.ps1
Created July 14, 2017 09:20
Powershell command for creating a skeleton .net core solution
param (
#[string]$server = "http://defaultserver",
[Parameter(Mandatory=$true)][string]$domain
#[string]$password = $( Read-Host "Input password, please" )
)
# assumes in folder you want solution
# assumes dotnet CLi is on the PATH
# global vars