Skip to content

Instantly share code, notes, and snippets.

View StefH's full-sized avatar

Stef Heyenrath StefH

View GitHub Profile
@StefH
StefH / gist:5b41c6f800c263d3de47ee54f062a0e0
Created September 15, 2024 12:29
WireMock.Net.Aspire - WireMockServerResource Mermaid
```mermaid
classDiagram
class WireMockServerResource {
}
class ContainerResource {
}
class IResourceWithServiceDiscovery {
}
@StefH
StefH / create.yaml
Last active January 19, 2024 08:36
yaml aaa
%YAML 1.2
---
YAML: YAML Ain't Markup Language™
What It Is:
YAML is a human-friendly data serialization
language for all programming languages.
YAML Resources:
YAML Specifications:
@StefH
StefH / FluentIt.cs
Last active February 16, 2022 14:25
FluentIt
using System;
using FluentAssertions;
using Moq;
using Xunit;
namespace TestProject1;
public static class FluentIt
{
public static TValue IsEquivalentTo<TValue>(TValue expectation)
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string"
},
"location": {
"type": "string"
},
@StefH
StefH / Azure_Pipelines_Create_Resources.cmd
Last active March 28, 2021 10:39
Azure_Pipelines_Create_Resources.cmd
az group create -n test-azuredevops -l westus2
az staticwebapp create -l westus2 -n test-azuredevops -g test-azuredevops -s "" -b "" --token "-"
pool:
vmImage: ubuntu-latest
steps:
- task: AzureStaticWebApp@0
inputs:
app_location: "Client" # App source code path
api_location: "Api" # Api source code path
output_location: "wwwroot" # Built app content directory
build_and_deploy_job:
name: Build and Deploy Job
steps:
...
- name: Build And Deploy
id: builddeploy
uses: Azure/[email protected]
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_*** }}
app_location: "Client" # App source code path
@StefH
StefH / index.html_loadResourceCallback.html
Last active June 20, 2020 12:16
window.loadResourceCallback
<app>
<div class="container-fluid">
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<p></p>
Loading Blazor WebAssembly...
<br />
<div class="progress">
<div id="progressbar" class="progress-bar progress-bar-striped active" role="progressbar" style="width:0"></div>
@StefH
StefH / blazor.webassembly.js-github-action.yml
Last active June 20, 2020 12:17
Patch blazor.webassembly.js
- name: Patch blazor.webassembly.js
uses: jacobtomlinson/gha-find-replace@master
with:
find: "return r.loadResource\\(o,t\\(o\\),e\\[o\\],n\\)"
replace: "var p = r.loadResource(o,t(o),e[o],n); p.response.then((x) => { if (typeof window.loadResourceCallback === 'function') { window.loadResourceCallback(Object.keys(e).length, o, x);}}); return p;"
include: "blazor.webassembly.js"
export class WebAssemblyResourceLoader {
// ...
loadResources(resources: ResourceList, url: (name: string) => string, resourceType: WebAssemblyBootResourceType): LoadingResource[] {
return Object.keys(resources)
.map(name => this.loadResource(name, url(name), resources[name], resourceType));
}
loadResource(name: string, url: string, contentHash: string, resourceType: WebAssemblyBootResourceType): LoadingResource {
const response = this.cacheIfUsed