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 / 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 / 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 / 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
@dburriss
dburriss / TextToList.fsx
Last active June 23, 2018 06:09
A F# script file showing parsing text to a typed list. Run with `fsi.exe TextToList.fsx`
open System
type Type1 = {
val1:string
val2:string
}
type Type2 = {
val1:string
val2:string
@dburriss
dburriss / New-Paket.ps1
Created June 27, 2018 04:50
Powershell script to get the latest version of Paket. I add it to my PS Profile.
function New-Paket {
mkdir .paket
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$tag = (Invoke-WebRequest -Uri https://api.github.com/repos/fsprojects/Paket/releases | ConvertFrom-Json)[0].tag_name
$uri = " https://github.com/fsprojects/Paket/releases/download/" + $tag + "/paket.bootstrapper.exe"
Invoke-WebRequest $uri -OutFile .paket/paket.exe
}