Skip to content

Instantly share code, notes, and snippets.

View oising's full-sized avatar
🐢
Taking it easy

Oisin Grehan oising

🐢
Taking it easy
View GitHub Profile
@davidfowl
davidfowl / ResourceModel.md
Last active May 8, 2025 15:26
Aspire Resource Model: Concepts, Design, and Authoring Guidance

Aspire Resource Model: Concepts, Design, and Authoring Guidance

Audience – Aspire integrators, advanced users, and contributors who are defining custom resource types, implementing publishers, or working across both runtime and publish workflows.
Just getting started? Jump straight to Quick Start and come back later for the deep‑dive.


Quick Start

A two‑minute "hello‑world" that shows the happy path.

@egil
egil / ObservableMemoryStorage.cs
Created February 13, 2025 15:56
A fake/observable implementation of Orleans IGrainStorage that can be used during testing
using System.Collections.Concurrent;
using System.Globalization;
using Orleans.Storage;
// https://www.nuget.org/packages/R3
using R3;
using Xunit.Sdk;
namespace Egil.Orleans.Storage.Testing;
public sealed class ObservableMemoryStorage : IGrainStorage
@ReubenBond
ReubenBond / ConcurrentLruGrainDirectoryCache.cs
Last active July 24, 2024 14:46
BitFaster.Caching Orleans IGrainDirectoryCache implementation
using BitFaster.Caching;
using BitFaster.Caching.Lru;
using Microsoft.Extensions.Options;
using Orleans.Configuration;
using Orleans.Runtime;
using Orleans.Runtime.GrainDirectory;
using System.Diagnostics.CodeAnalysis;
namespace Orleans.BitFasterCaching.GrainDirectoryCache;
@wekempf
wekempf / LoggingExtra.cs
Created June 9, 2021 00:11
Microsoft.Extensions.Logging with extra data
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
@creyke
creyke / OrleansEventHubCustomData.cs
Created September 21, 2020 14:19
Orleans Event Hub Custom Data
public class CustomEventHubDataAdapter : EventHubDataAdapter
{
private readonly SerializationManager serializationManager;
public CustomEventHubDataAdapter(SerializationManager serializationManager)
: base(serializationManager)
{
this.serializationManager = serializationManager;
}
@thomastay
thomastay / prompt.ps1
Last active April 3, 2023 15:00
Powershell fish prompt
function replaceHome($pathArray) {
# Check whether the first three paths are equal to HOME
# If it is, it substitutes it for ~
# Change this accordingly, if your home path is more than three
# paths long.
$splitChar = [System.IO.Path]::DirectorySeparatorChar
if ( ($pathArray.Length -gt 2) -and
(($pathArray[0..2] -join $splitChar) -eq $HOME)) {
@("~") + $pathArray[3..$pathArray.Length]
}
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@krist00fer
krist00fer / Get-AzureUsageCost.ps1
Last active May 8, 2024 16:39
PowerShell Script to retrieve Azure Usage and Cost/Pricing
# Licensed under the MIT license.
# Copyright (C) 2017 Kristofer Liljeblad
# 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 all copies or substantial portions of the Software.
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@Rich-Harris
Rich-Harris / footgun.md
Last active March 9, 2025 06:13
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological