Skip to content

Instantly share code, notes, and snippets.

View mqudsi's full-sized avatar

Mahmoud Al-Qudsi mqudsi

View GitHub Profile
Washi1337 / TinySharp.cs
Last active November 30, 2023 15:35
A program to emit a tiny .NET binary program printing Hello World to the standard output. Blog post:
View TinySharp.cs
using System.Text;
using AsmResolver;
using AsmResolver.DotNet;
using AsmResolver.DotNet.Builder.Metadata.Blob;
using AsmResolver.DotNet.Builder.Metadata.Strings;
using AsmResolver.DotNet.Code.Cil;
using AsmResolver.DotNet.Signatures;
using AsmResolver.IO;
using AsmResolver.PE;
using AsmResolver.PE.DotNet.Builder;
dadhi / main.cs
Last active September 28, 2022 15:04
Discriminated Union (sum-type, co-product) from Algebraic Data Types (ADT) for C# which is memory efficient, supports one-line sub-typing
View main.cs
using System;
using System.Collections.Generic;
using static System.Console;
namespace Union
class Program
public static void Main()
fphilipe / exclude.sql
Last active November 12, 2023 12:41
PostgreSQL EXCLUDE constraint
View exclude.sql
CREATE TABLE room_reservations (
room_id integer,
reserved_at timestamptz,
reserved_until timestamptz,
canceled boolean DEFAULT false,
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH &&
) WHERE (not canceled)
View regex-weburl.js
// Regular Expression for URL validation
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
// Copyright (c) 2010-2018 Diego Perini (