Skip to content

Instantly share code, notes, and snippets.

@atifaziz
atifaziz / ProgramArguments.cs
Created Jun 18, 2022
Code generated by docopt.net for grpc-curl's usage; see https://github.com/xoofx/grpc-curl
View ProgramArguments.cs
#nullable enable annotations
using System.Collections;
using System.Collections.Generic;
using DocoptNet;
using DocoptNet.Internals;
using Leaves = DocoptNet.Internals.ReadOnlyList<DocoptNet.Internals.LeafPattern>;
namespace GrpcCurl
{
@atifaziz
atifaziz / Vipr.Bootstrapper-Arguments.cs
Last active Apr 4, 2022
Code generated by docopt.net for Vipr's usage; see https://github.com/microsoft/Vipr
View Vipr.Bootstrapper-Arguments.cs
#nullable enable annotations
using System.Collections;
using System.Collections.Generic;
using DocoptNet;
using DocoptNet.Internals;
using Leaves = DocoptNet.Internals.ReadOnlyList<DocoptNet.Internals.LeafPattern>;
namespace Vipr
{
@atifaziz
atifaziz / ProgramArguments.cs
Created Mar 31, 2022
Code generated by docopt.net for dotnet-file's usage
View ProgramArguments.cs
#nullable enable annotations
using System.Collections;
using System.Collections.Generic;
using DocoptNet;
using DocoptNet.Internals;
using Leaves = DocoptNet.Internals.ReadOnlyList<DocoptNet.Internals.LeafPattern>;
namespace Devlooped
{
@atifaziz
atifaziz / ProgramArguments.cs
Created Mar 31, 2022
Code produced by the C# source generator of docopt.net for the Naval Fate example
View ProgramArguments.cs
#nullable enable annotations
using System.Collections;
using System.Collections.Generic;
using DocoptNet;
using DocoptNet.Internals;
using Leaves = DocoptNet.Internals.ReadOnlyList<DocoptNet.Internals.LeafPattern>;
namespace NavalFate
{
@atifaziz
atifaziz / Extensions.cs
Last active Mar 2, 2022
Extension to run tasks concurrently and return an array when all have completed
View Extensions.cs
#region Copyright (c) Microsoft. All rights reserved.
//
// 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:
//
// The above copyright notice and this permission notice shall be included in
@atifaziz
atifaziz / git-branch-orphan.ps1
Last active Sep 7, 2021
Create an orphan branch without checking it out
View git-branch-orphan.ps1
git stash # 1. save index changes
git rm -r --cached . # 2. empty the index
git branch orphan ( # 5. create the orphan branch
git commit-tree -m 'Empty commit' ( # 4. commit the empty tree
git write-tree)) # 3. write the empty index
git reset HEAD # 6. revert emptying of the index
git stash pop --index # 7. restore stashed changes
@atifaziz
atifaziz / EmptySet.cs
Created Aug 2, 2021
An empty set implementation
View EmptySet.cs
#region Copyright (c) 2021 Atif Aziz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@atifaziz
atifaziz / NCrontabFieldsDemo.csproj
Created Nov 7, 2020
NCrontab demo showing direct use of CrontabField
View NCrontabFieldsDemo.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ncrontab" Version="3.3.1" />
@atifaziz
atifaziz / Util.linq
Last active Aug 27, 2020
LINQPadless helper for LINQPad's Util 📄 http://share.linqpad.net/age6lg.linq
View Util.linq
<Query Kind="Program">
<Namespace>System.Globalization</Namespace>
<RemoveNamespace>System.Collections</RemoveNamespace>
<RemoveNamespace>System.Data</RemoveNamespace>
<RemoveNamespace>System.Diagnostics</RemoveNamespace>
<RemoveNamespace>System.Linq.Expressions</RemoveNamespace>
<RemoveNamespace>System.Reflection</RemoveNamespace>
<RemoveNamespace>System.Text</RemoveNamespace>
<RemoveNamespace>System.Text.RegularExpressions</RemoveNamespace>
<RemoveNamespace>System.Threading</RemoveNamespace>
@atifaziz
atifaziz / WebLinqData.linq
Last active Sep 20, 2020
LINQPad helper for WebLINQ
View WebLinqData.linq
<Query Kind="Program">
<NuGetReference Version="4.0.0">System.Reactive</NuGetReference>
<NuGetReference Version="4.5.0">System.Text.Encoding.CodePages</NuGetReference>
<NuGetReference Version="1.0.0-alpha-20200416" Prerelease="true">WebLinq</NuGetReference>
<Namespace>System.CodeDom.Compiler</Namespace>
<Namespace>System.Globalization</Namespace>
<Namespace>System.Net</Namespace>
<Namespace>System.Net.Http</Namespace>
<Namespace>System.Net.Http.Headers</Namespace>
<Namespace>System.Reactive</Namespace>