This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseUri = new Uri("foo://testy"); | |
//Test1 - "*" | |
var templates1 = new Dictionary<UriTemplate, object>() | |
{ | |
{ new UriTemplate("*") , "[star]" }, | |
}; | |
var templateTable1 = new UriTemplateTable(baseUri, templates1); | |
templateTable1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory = $true)] | |
[string]$websiteName, | |
[Parameter(Mandatory = $true)] | |
[string]$sourceDir, | |
[string]$destinationPath = "/site/wwwroot" | |
) | |
# Usage: .\kuduSiteUpload.ps1 -websiteName mySite -sourceDir C:\Temp\mydir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//License: MIT | |
//using System.Xml; | |
//using System.Xml.Schema; | |
public static List<ValidationEventArgs> ValidateXmlWithXsd(string xmlPath, string xsdPath) | |
{ | |
XmlSchemaSet s = new XmlSchemaSet(); | |
var args = new List<ValidationEventArgs>(); | |
using (XmlReader reader = XmlReader.Create(xsdPath)) | |
{ | |
//These validations will be from reading the xsd itself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln | |
# Get the path that the user specified when calling the script | |
$solution = $args[0] | |
$solutionPath = Split-Path $solution -Parent | |
$solutionName = Split-Path $solution -Leaf | |
# Delete the .nuget directory and all contents | |
Remove-Item (Join-Path $solutionPath ".nuget") -Force -Recurse -ErrorAction 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class StringExt | |
{ | |
public static int GetHashCode32(this string s) | |
{ | |
var chars = s.ToCharArray(); | |
var lastCharInd = chars.Length - 1; | |
var num1 = 0x15051505; | |
var num2 = num1; | |
var ind = 0; | |
while (ind <= lastCharInd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using ReactiveUI; | |
namespace SaveAllTheTime.Models | |
{ | |
interface IFilesystemWatchCache | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2017 Chris Patuzzo | |
https://twitter.com/chrispatuzzo | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This task takes in a XDT transform file and transforms it, following any inheritance chain. | |
There should be at least one base transform for this to work; otherwise just use Microsoft's | |
regular TransformXml task. --> | |
<!-- EXAMPLE USAGE: | |
<TransformXmlHierarchy | |
Source="source.xml" | |
Destination="transformed.xml" | |
TaskDirectory="path/to/directory/of/Microsoft.Web.Publishing.Tasks" /> | |
--> | |
<UsingTask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Windows.Markup; | |
using System.Globalization; | |
using System.Windows.Data; | |
using System.Diagnostics; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Media; |
NewerOlder