This explains and demos how to use diagrams.net (draw.io) diagrams in your GitHub repo.
- See repo for more details
- Diagrams are stored in your repository with your code and docs
- Diagram access is controlled by GitHub repository access
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using System.Text.Json; | |
using System.Text.Json.Serialization.Metadata; | |
public static class JsonSerializerExt | |
{ | |
// Dynamically attach a JsonSerializerOptions copy that is configured using PopulateTypeInfoResolver | |
private readonly static ConditionalWeakTable<JsonSerializerOptions, JsonSerializerOptions> s_populateMap = new(); |
{ | |
"0":{ | |
"day":{ | |
"description":"Sunny", | |
"image":"http://openweathermap.org/img/wn/[email protected]" | |
}, | |
"night":{ | |
"description":"Clear", | |
"image":"http://openweathermap.org/img/wn/[email protected]" | |
} |
//Snippet from Program.cs which adds the provider and sets up a Settings class to map the settings | |
using ErikNoren.Configuration; | |
using TestMvcWebApplication; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Configuration.AddSqlDatabase(config => | |
{ | |
//We can get the connection string from previously added ConfigurationProviders to use in setting this up | |
config.ConnectionString = builder.Configuration.GetConnectionString("DemoDatabase"); |
This explains and demos how to use diagrams.net (draw.io) diagrams in your GitHub repo.
<# | |
.SYNOPSIS | |
Create an OpenSSH compatible Public and Private Key in pure Powershell | |
.DESCRIPTION | |
Many scripts rely on the openssh or openssl tools to be available to generate public and private keys compatible with OpenSSH, but this script relies purely on Powershell (and some .NET classes already included) to generate public and private keys. | |
.EXAMPLE | |
PS /git/scripts> ./Create-OpenSSHPubAndPrivateKeys.ps1 -PublicKeyPath my-key.pub -PrivateKeyPath my-key | |
.LINK | |
mailto:[email protected] | |
#> |
/* | |
Simple OpenSCAD DIN rail clip. | |
*/ | |
module clip(z = 6) { | |
a = 7; | |
b = 1.2; // metal sheet thickness, should be ~ 1 | |
c = 2.5; |
{ | |
"defaultProfile": "{7d04ce37-c00f-43ac-ba47-992cb1393215}", | |
"initialRows": 30, | |
"initialCols": 120, | |
"alwaysShowTabs": true, | |
"showTerminalTitleInTitlebar": true, | |
"experimental_showTabsInTitlebar": true, | |
"requestedTheme": "dark", | |
"profiles": [ | |
{ |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Authorization; | |
namespace DamienBraillard.AspNetCoreSimpleRoleAuthorization | |
{ | |
/// <summary> | |
/// Defines the base functionality of the class used to provide applicative roles for a user when using the simple role | |
/// authorization. | |
/// </summary> |
The quotes on this page come from this deleted question on Stackoverflow:
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program { | |
public static void Main() { | |
// Test data | |
byte[] prefix = { 0xDE, 0xAD, 0xBE, 0xEF }; // 4 bytes | |
byte[] block1 = { 0xAA, 0xAA, 0xAA, 0xAA }; // 4 bytes | |
byte[] block2 = { 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, }; // 8 bytes |