Skip to content

Instantly share code, notes, and snippets.

View filipw's full-sized avatar
🦄
¯\_(ツ)_/¯

Filip W filipw

🦄
¯\_(ツ)_/¯
View GitHub Profile
@boraseoksoon
boraseoksoon / MonacoWebView.swift
Created March 5, 2023 08:40
Load Monaco editor in a single html file for MacOS SwiftUI
import SwiftUI
import WebKit
@main
struct MonacoApp: App {
let codeSnippet = """
var body: some Scene {
WindowGroup {
EditorView(content: codeSnippet, language: "swift", theme: "vs-dark")
}
@jsquire
jsquire / custom-endpoint-address.md
Last active October 9, 2023 15:05
Event Hubs: Custom Endpoint Support

Event Hubs: Custom Endpoint Support

Connections to the Azure Event Hubs service are made using the fully qualified namespace name assigned for the Event Hubs namespace as the root of the endpoint address. Because the Event Hubs service ensures the appropriate CNAME records are configured in DNS as part of the provisioning process, this provides an endpoint address that is strongly associated with the Event Hubs namespace and easier for developers to remember.

While the standard approach works well under normal circumstances, it can be troublesome in certain environments when a proxy is in use or when an Express Route circuit is used with certain configuration. In these scenarios, an alternative host name is needed to allow for proper routing to the Event Hubs service.

Things to know before reading

  • The names used in this document are intended for illustration only. Some names are not ideal and will need to be refined during discussions.
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@clemensv
clemensv / gist:6554605
Last active April 6, 2018 03:16
using Task.WhenAny to drive a pump of multiple async operations in the same context (such as an I/O pump)
/*
Example use (from an email I sent)
I’m using WhenAny to either register for a callback on any of the pending operations and to use
the IO thread that comes up with their respective completion or to execute handling of completed
work on the current thread (‘borrowing’ the IO thread).
So if I read from a socket and from a queue, first both ops hang. Queue read completes and I get
called back on an IO thread which continues the await. I process that completion in the loop.
Meanwhile the socket read completes. That IO thread pops up and just registers the fact that it’s
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@hyrmn
hyrmn / EndToEndTests.cs
Created July 29, 2012 16:27
My incomplete but evolving understanding of CQRS
using System;
using System.Reflection;
using CommonDomain;
using CommonDomain.Core;
using CommonDomain.Persistence;
using CommonDomain.Persistence.EventStore;
using EventStore;
using EventStore.Dispatcher;