Skip to content

Instantly share code, notes, and snippets.

View rulrok's full-sized avatar
🏠
Working from home

Reuel Ramos Ribeiro rulrok

🏠
Working from home
View GitHub Profile
@johnazariah
johnazariah / LinqExtensions.cs
Last active March 28, 2024 08:50
Maybe Monad in C#
public static partial class LinqExtensions
{
public static Maybe<C> SelectMany<A, B, C>(this Maybe<A> ma, Func<A, Maybe<B>> f, Func<A, B, C> select) => ma.Bind(a => f(a).Map(b => select(a, b)));
}
<#
.NOTES
Licensed under WTFPL, Version 2.
.SYNOPSIS
Extracts the DB-schema from the latest EF migration in the specified database.
.DESCRIPTION
Writes the extracted schema to the output file in the EDMX format.
The "(local)" server is used.
.PARAMETER Database
The database with EF migrations (in the __MigrationHistory table).
@IgnoredAmbience
IgnoredAmbience / 99-noto-mono-color-emoji.conf
Last active March 27, 2024 03:39
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
@IDisposable
IDisposable / DomainRoute.cs
Last active January 14, 2020 16:22
Domain (hostname) Routing for Asp.Net MVC and WebAPI
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Http;
using System.Web.Http.Routing;
using System.Web.Mvc;