Skip to content

Instantly share code, notes, and snippets.

namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
public sealed class ExtensionAttribute : Attribute { }
}
@jarlef
jarlef / update-hosts
Last active October 4, 2023 10:27
Shell script to update hosts file
#! /bin/sh
# @author: Jarle Friestad
# Based on script by Claus Witt (http://clauswitt.com/319.html)
# Adding or Removing Items to hosts file
# Use -h flag for help
DEFAULT_IP=127.0.0.1
IP=${3:-$DEFAULT_IP}
@jarlef
jarlef / EnumerateMessages.cs
Last active January 30, 2023 12:37
Hot Chocolate - Extended Source Stream
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using HotChocolate.Execution;
namespace HC.Example;
public class EnumerateMessages<T> : IAsyncEnumerable<T>
{