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.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
using Serilog; |
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
function autobind<TFunction extends Function>(constructor: TFunction):TFunction { | |
const newConstructor = function(...args) { | |
constructor.apply(this, args); | |
for (const property in this) { | |
if (typeof this[property] !== typeof Function) { | |
continue; | |
} | |
this[property] = this[property].bind(this); | |
} |
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 Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using Serilog.Events; | |
using Serilog.Parsing; |
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.Globalization; | |
using System.Reflection; | |
using TechTalk.SpecFlow; | |
using TechTalk.SpecFlow.Bindings; | |
using TechTalk.SpecFlow.Bindings.Reflection; | |
using TechTalk.SpecFlow.Tracing; | |
using Xamarin.UITest; | |
using Xamarin.UITest.Events; |
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 SystemTime | |
{ | |
private static ITimeProvider _timeProvider = new RealTimeProvider(); | |
public static DateTime UtcNow | |
{ | |
get { return _timeProvider.UtcNow; } | |
} | |
public static IDisposable MockTime(DateTime utcNow) |
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
// Conventionally register types implementing a single I[Classname] interface. | |
builder.RegisterAssemblyTypes(assemblies) | |
.Where(x => x.GetInterfaces().Count() == 1 && x.GetInterface("I" + x.Name) != null) | |
.AsImplementedInterfaces(); | |
// Register types as themselves. | |
builder.RegisterAssemblyTypes(assemblies) | |
.AsSelf(); |
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
# Load posh-git profile | |
. 'C:\Projects\Tools\posh-git\profile.example.ps1' | |
function vsh() { | |
Write-Output "Opening first solution..." | |
$sln = (dir -in *.sln -r | Select -first 1) | |
Write-Output "Found $($sln.FullName)" | |
Invoke-Item $sln.FullName | |
} |
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
// FNV-1a (64-bit) non-cryptographic hash function. | |
// Adapted from: http://github.com/jakedouglas/fnv-java | |
public ulong HashFNV1a(byte[] bytes) | |
{ | |
const ulong fnv64Offset = 14695981039346656037; | |
const ulong fnv64Prime = 0x100000001b3; | |
ulong hash = fnv64Offset; | |
for (var i = 0; i < bytes.Length; i++) | |
{ |
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
$('<img>') | |
.on('load', function() { console.log('image loaded'); }) | |
.attr('src', 'http://www.google.com/favicon.ico?'+(new Date()).getTime()); |
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
@echo OFF | |
set PID="No" | |
for /F "tokens=1-2" %%A in ('tasklist /FI "USERNAME eq stpem" /FI "IMAGENAME eq PROASK.Client.Shell.exe" /NH') do ( | |
echo Found process: %%A - PID: %%B | |
set PID="%%B" | |
) | |
IF %PID% == "No" GOTO :EOF |
NewerOlder