from TheLaughingMan on gitter June 17, 2021 10:24 AM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Input Test</title> | |
<style> | |
.container { | |
width:90%; | |
max-width:900px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$token = <your github personal token> | |
$headers = @{"Authorization"="token $token"} | |
$body = (ConvertTo-Json @{ default_branch='main' }) | |
Write-Host "Fetching repo list" | |
[Console]::Out.Flush() | |
$repos = Invoke-RestMethod -Headers $headers -Method GET -Uri "https://api.github.com/user/repos?type=owner&per_page=80" | |
foreach($repo in $repos) { | |
if($repo.default_branch -eq "master") | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyBase : ComponentBase | |
{ | |
string someValue = "test"; | |
public MyBase() | |
{ | |
var rf = typeof(ComponentBase).GetField("_renderFragment", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); | |
var pqr= typeof(ComponentBase).GetField("_hasPendingQueuedRender", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); | |
var nr= typeof(ComponentBase).GetField("_hasNeverRendered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); | |
rf.SetValue(this, (RenderFragment)(builder => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CssHelper | |
{ | |
public static string GenerateScope(string targetName, string relativePath) | |
{ | |
using var hash = SHA256.Create(); | |
var bytes = Encoding.UTF8.GetBytes(relativePath.ToLowerInvariant().Replace("\\", "//") + targetName); | |
var hashBytes = hash.ComputeHash(bytes); | |
var builder = new StringBuilder(); | |
builder.Append("b-"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName PresentationFramework, System.Drawing, System.Windows.Forms | |
$icon = New-Object System.Windows.Forms.NotifyIcon | |
$icon.icon = New-Object System.Drawing.Icon("someicon.ico") | |
$icon.Visible = $true |
This goes into your msbuild config (normally csproj
) and runs before the Publish
Task, before files are copied to the final destination.
<!-- 2022 @SQL-MisterMagoo containing some code from (c) .NET Foundation. All rights reserved. -->
<PropertyGroup Condition="'$(_BlazorWebAssemblySdkToolAssembly)'==''">
<_SDKRoot>$(NetCoreRoot)sdk\$(NETCoreSDKVersion)\Sdks</_SDKRoot>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.NET SDK: | |
Version: 7.0.101 | |
Commit: bb24aafa11 | |
Runtime Environment: | |
OS Name: Windows | |
OS Version: 10.0.25267 | |
OS Platform: Windows | |
RID: win10-x64 | |
Base Path: C:\Program Files\dotnet\sdk\7.0.101\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"runtimeOptions": { | |
"tfm": "net7.0", | |
"framework": { | |
"name": "Microsoft.NETCore.App", | |
"version": "7.0.8" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
/* Setup */ | |
Thing[] someThings = { new("1"), new("2") }; | |
var myThings = new Things(someThings); | |
/* Staying in dotnet - this all works as expected */ | |
var asInterfaces = myThings as IThings; |
OlderNewer