Skip to content

Instantly share code, notes, and snippets.

View StefH's full-sized avatar

Stef Heyenrath StefH

View GitHub Profile
@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/static-web-apps-deploy@v0.0.1-preview
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
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using AngleSharpWrappers;
using Bunit;
using Microsoft.AspNetCore.Components;
namespace ConsoleAppBUnit