Skip to content

Instantly share code, notes, and snippets.

@Tewr
Tewr / MappingExtensions.cs
Created March 26, 2019 12:50
Provides object extensions Map and Tap. Like LINQ Select, but for non-collections. int.Parse("5") becomes "5".Map(int.Parse).
public static class MappingExtensions
{
/// <summary>
/// Applies the specified <paramref name="transformation"/> on the <paramref name="source"/>.
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <param name="transformation"></param>
/// <returns></returns>
@Tewr
Tewr / Program.cs
Created April 1, 2019 10:04
Reflection-based console app to call and debug simple task-based api's
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Good_Gaz.Services.SirsConsoleClient
{
@Tewr
Tewr / Find what.Regex
Created August 20, 2019 13:39
Visual studio INotifyPropertyChanged Regex
public ([^\s ]+) ([^\s]+) { get; set; }
@Tewr
Tewr / AssemblyProduct.ps1
Created October 8, 2019 05:24
Azure devops: Put git source version and build date in AssemblyProduct
# $Env:SubDirectoryFilter is a custom parameter
$searchPath = "$Env:BUILD_SOURCESDIRECTORY\$Env:SubDirectoryFilter"
$shortCommit = "$Env:BUILD_SOURCEVERSION".Substring(0, 8)
$shortCommit = "@$shortCommit"
$date = [System.DateTime]::Now.ToString("s")
Write-Host "Searching in $searchPath"
Get-ChildItem -Path $searchPath -Recurse -Filter "AssemblyInfo.*" | foreach {
$file = $_.FullName
@Tewr
Tewr / TestingLinqSerializer.cs
Last active October 15, 2019 08:42
Testing Serialize.Linq for remoting proxy
using Newtonsoft.Json;
using Serialize.Linq.Extensions;
using Serialize.Linq.Nodes;
using System;
using System.Linq.Expressions;
namespace TestingLinqSerializer
{
class Program
{