Diff:
C:\Program Files\Perforce\p4merge.exe -nl %bname -nr %yname %base %mine
Merge:
C:\Program Files\Perforce\p4merge.exe -nb %bname -nl %tname -nr %yname -nm %mname %base %theirs %mine %merged
View run-cli.csproj
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
<Project> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<OutputType>Exe</OutputType> | |
<OutDir>build/bin</OutDir> | |
<BaseIntermediateOutputPath>build/obj</BaseIntermediateOutputPath> | |
</PropertyGroup> | |
<Target Name="PrepareProgram" BeforeTargets="BeforeBuild"> | |
<PropertyGroup> |
View TortoiseSVN+P4Merge.md
View NuGet_profile.ps1
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
# For each package, lists which projects it is installed in | |
function Write-PackageProjectInstalls([string] $PackageFilter = '') { | |
Set-StrictMode -Version 2 | |
$ErrorActionPreference = 'Stop' | |
Get-Project -All | | |
% { | |
$ProjectName = $_.ProjectName | |
Get-Package $PackageFilter -Project $ProjectName | | |
% { New-Object PSObject -Prop (@{ ProjectName=$ProjectName; PackageId=$_.Id; Version = $_.Version; }) } |
View CSharp6.md
String interpolation
var x = 1;
// same as string.Format("A {0} B", x)
var y1 = $"A {x} B"; // y == "A 1 B"
// $@ for multiline
var y2 = $@"A
View QueryPropagatingRoute.cs
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
private class QueryPropagatingRoute : RouteBase { | |
private readonly RouteBase target; | |
private readonly string[] queryStringKeys; | |
public QueryPropagatingRoute(RouteBase target, params string[] queryStringKeys) { | |
this.target = target; | |
this.queryStringKeys = queryStringKeys; | |
} | |
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { |
View MonoidsInCSharp.cs
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 class Monoid<T> { | |
public T None { get; private set; } | |
public Func<T, T, T> Operation { get; private set; } | |
public Monoid(Func<T,T,T> operation, T none) { | |
this.Operation = operation; | |
this.None = none; | |
} | |
} |
View OwinWebSocket.cs
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.Threading.Tasks; | |
using System.Net.WebSockets; | |
using System.Threading; | |
// This is bad and potentially unreliable code, which only serves as a base for | |
// further improvements. Please do not use it as is. | |
namespace MirrorSharp.Owin.Internal { |
View Update-FromGitHubUpstream.ps1
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
Set-StrictMode -Version 2 | |
$ErrorActionPreference = 'Stop' | |
function Write-ColorOutput([Parameter(Mandatory=$true)] $inputObject, [System.ConsoleColor] $foregroundColor) { | |
$rawUI = $Host.UI.RawUI | |
$saved = $rawUI.ForegroundColor | |
try { | |
$rawUI.ForegroundColor = $foregroundColor | |
Write-Output $inputObject | |
} |
View AutofacCompositeExtensionsPrototype.cs
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 AutofacCompositeExtensions { | |
public static IRegistrationBuilder<TImplementer, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterComposite<TImplementer>(this ContainerBuilder builder) { | |
var registrationBuilder = RegistrationBuilder.ForType<TImplementer>(); | |
builder.RegisterCallback(registry => { | |
registrationBuilder.OnPreparing(e => { | |
foreach (var service in e.Component.Services.OfType<IServiceWithType>()) { | |
e.Parameters = e.Parameters.Concat(new[] { | |
new ResolvedParameter( | |
(p, _) => IsCollectionOf(p.ParameterType, service), | |
(_, c) => ResolveCollection(c, service, e.Component) |
View htmlpeek.js
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 init = function($) { | |
$("<style type='text/css'></style>").text('.cx { background: #f5f2f0; color: black; }' + | |
' .cx .tag { color: #999; }' + | |
' .cx .tag .title, .cx .css .attribute { color: #905; }' + | |
' .cx .tag .attribute, .cx .string, .cx .css .tag, .cx .css .class { color: #690; }' + | |
' .cx .tag .value, .cx .keyword { color: #07a; }' + | |
' .cx { font-family: Consolas, Courier New; position: absolute; z-index: 50000; left: 0; top: 0; right: 0; white-space: pre; }') | |
.appendTo($('head')); | |
var source = $('<code></code>').text(document.documentElement.outerHTML) |
NewerOlder