Skip to content

Instantly share code, notes, and snippets.

@ursenzler
ursenzler / FsharpFluentAssertionsExtensions
Created February 11, 2021 12:47
Our wrappers around FluentAssertions to make them simpler to use from F# code.
[<AutoOpen>]
module FluentAssertionsExtensionMethods
open System
open System.Collections
open System.Runtime.CompilerServices
open FluentAssertions
open FluentAssertions.Collections
open FluentAssertions.Equivalency
open FluentAssertions.Numeric
@swlaschin
swlaschin / FsCsInterop.md
Last active May 26, 2024 03:50
F# to C# interop tips

Tips on exposing F# to C#

Api and Methods

I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.

In this file:

  • Define functions with PascalCase names. They will appear to C# as static methods.
  • Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.
@ReubenBond
ReubenBond / ILFieldBuilder.cs
Created October 12, 2016 01:58
Generating static fields on the fly in C# (for use in other codegen)
using System;
using System.Collections.Concurrent;
using System.Reflection;
using System.Reflection.Emit;
internal class ILFieldBuilder
{
private static readonly AssemblyBuilder AssemblyBuilder =
AssemblyBuilder.DefineDynamicAssembly(
new AssemblyName(nameof(ILFieldBuilder)),
@andykuszyk
andykuszyk / Creating and Publishing NuGet Packages.md
Last active July 8, 2021 14:51
Creating and Publishing NuGet Packages

Creating and Publishing NuGet Packages

Introduction

This document describes how to publish a nuget packages by creating a nuspec and then publishing it to a server.

How do we get from dll to publish nuget package?

In order to publish dlls as a nuget package, we need to perform these three steps:

  1. Create a nuspec;
  2. Pack the nuspec;
@kzu
kzu / ObservableDictionary.cs
Last active October 6, 2023 11:01
An ObservableDictionary<TKey, TValue>
// Licensed by Daniel Cazzulino under the MIT License
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using System.Text;
@Potherca
Potherca / README.md
Last active November 27, 2023 17:44
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and any online request app this is a piece of cake!

Just follow these steps:

  1. Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs with the following as the POST body :