Skip to content

Instantly share code, notes, and snippets.

View cezarypiatekGC's full-sized avatar

Cezary Piątek cezarypiatekGC

  • Gain Capital
View GitHub Profile
public struct DisposableOwner<T> : IDisposable where T : IDisposable
{
private T _owned;
private bool _isReleased;
public DisposableOwner(T owned) => (_owned, _isReleased) = (owned, false);
public T Release()
{
if (_isReleased)
NPM [Non-Farm Payroll Report] - https://www.investopedia.com/articles/forex/09/non-farm-payroll-report.asp
DAX - DAX® is Deutsche Börse’s blue chip index for the German stock market – one of the most efficient stock markets in Europe. e.
It comprises the 30 largest and most actively traded German companies
Indicative Quote - A money maker forex quote that is informative only - the quoted price may not be available to trade for. https://www.investopedia.com/terms/i/indicativequote.asp
Firm Quote - A firm quote is a bid to buy or offer to sell a security or currency at the firm bid and ask prices, that is not subject to cancellation https://www.investopedia.com/terms/f/firmquote.asp
Depth of the Book - https://en.wikipedia.org/wiki/Order_book_(trading)
DMA - Direct market access (DMA) is a way of placing trades directly in the underlying market – whether that’s on the order books of an exchange or multilateral trading facility (MTF), or with another liquidity provider. DMA can give traders more f
public static class PatchExtensions
{
public static bool HasBeenChanged<T, TProperty>(this JsonPatchDocument<T> patch, Expression<Func<T, TProperty>> field) where T : class
{
var fieldPathWithPrefix = field.Body.ToString().Replace(".", "/");
var fieldPath = fieldPathWithPrefix.Substring(fieldPathWithPrefix.IndexOf("/", StringComparison.InvariantCulture));
return patch.Operations.Any(x => x.path == fieldPath);
}
}
# CS8603: Possible null reference return.
dotnet_diagnostic.CS8603.severity = error
# CS8604: Possible null reference argument.
dotnet_diagnostic.CS8604.severity = error
# CS8606: Possible null reference assignment to iteration variable
dotnet_diagnostic.CS8606.severity = error
# CS8600: Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = error
# CS8602: Dereference of a possibly null reference.
dotnet_diagnostic.CS8602.severity = error
$parents = $(git log --pretty=%P -n 1) -split '\s'
$messages = git log --pretty=%s "$($parents[0])...$($parents[1])"
foreach($message in $messages)
{
if($message -NotMatch "^[a-z]+-[0-9]+:")
{
Write-Error "Commit message missing JIRA prefix: $message"
}else
{
Write-Host "Message ok: $message"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Moq" Version="4.12.0" />
</ItemGroup>