openssl genrsa -des3 -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem -addext "subjectAltName = DNS:localhost"
openssl pkcs12 -export -out certificate.pfx -inkey rootCA.key -in rootCA.pem
openssl pkcs12 -in certificate.pfx -clcerts -out pfx.pem
sudo cp pfx.pem /usr/local/share/ca-certificates/pfx.crt
sudo cp pfx.pem /usr/share/ca-certificates/pfx.crt
sudo bash -c "echo "pfx.crt" >> /etc/ca-certificates.conf"
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
> What is the difference in weather between San Fran and Chicago in C | |
calling open ai | |
Function call: getWeather({"Location": "San Francisco"}) -> Cold, 22 C | |
Function call: getWeather({"Location": "Chicago"}) -> Sunny, 25 C | |
calling open ai | |
Function call: add({"Left":25,"Right":-22}) -> 3 | |
calling open ai |
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
global using Microsoft.CodeAnalysis; | |
global using Microsoft.CodeAnalysis.CSharp.Syntax; | |
using System.Diagnostics; | |
namespace Srcgen; | |
/// <summary> | |
/// Author: Saahil Claypool | |
/// https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md |
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 Polly; | |
using Polly.RateLimit; | |
// See https://aka.ms/new-console-template for more information | |
Console.WriteLine("Hello, World!"); | |
var task = (int i) => Console.WriteLine($"Firing {i}"); | |
var rateLimit = Policy.RateLimitAsync(10, TimeSpan.FromMinutes(1), 5); |
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
// Copyright (c) Microsoft Corporation, Inc. All rights reserved. | |
// Copyright (c) Saahil Claypool | |
// Licensed under the MIT License | |
namespace SyncOverAsync; | |
public static class AsyncHelper | |
{ | |
private static readonly TaskFactory _myTaskFactory = | |
new(CancellationToken.None, |
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 struct Maybe<T> | |
{ | |
private readonly T _value; | |
public T Value { get => IsSome ? _value : throw new NullReferenceException(); } | |
public bool IsSome { get; set; } | |
public Maybe() | |
{ | |
IsSome = false; | |
_value = default!; |
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; | |
namespace Utils | |
{ | |
public struct Option<T> | |
{ | |
public T Value { get; set; } | |
public bool HasValue { get; set; } | |
private Option(T value, bool hasValue) |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
<GenerateProgramFile>false</GenerateProgramFile> | |
<!-- This stops c# from creating th stub main automatically --> | |
<!-- https://andrewlock.net/fixing-the-error-program-has-more-than-one-entry-point-defined-for-console-apps-containing-xunit-tests/ --> | |
</PropertyGroup> | |
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
[buildPlans.iosevka-saapro] | |
family = "Iosevka SaaPro" | |
desc = "Hybrid, like iA Writer’s Duo" | |
spacing = "quasi-proportional" | |
no-cv-ss = true | |
no-ligation = false | |
snapshotFamily = 'iosevka-saapro' | |
[buildPlans.iosevka-saapro.variants] | |
inherits = "ss20" |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.HttpsPolicy; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; |
NewerOlder