This file contains hidden or 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
<Main>g__Operator|4_0 (String, String) | |
L0000 jmp System.String.Equals(System.String, System.String) | |
<Main>g__Equals|4_1 (String, String) | |
L0000 mov rax, 0x7fff58527b68 | |
L000a mov rax, [rax] | |
L000d cmp [rcx], ecx | |
L000f jmp rax | |
<Main>g__EqualsComparer|4_2<T> (T, T) |
This file contains hidden or 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
var profile = "YOUR_PROFILE_NAME"; | |
var credentials = LoadSsoCredentials(profile); | |
// any operation you want to do with sso credentials. | |
var s3client = new AmazonS3Client(credentials, RegionEndpoint.APNortheast1); | |
var buckets = await s3client.ListBucketsAsync(); | |
buckets.Dump(); | |
static AWSCredentials LoadSsoCredentials(string profileName) | |
{ |
This file contains hidden or 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
// before .NET 5: Array Bound Check emitted. (BAD) | |
// after .NET 6: Array Bound Check removed. (GOOD) | |
void A(int[] a) | |
{ | |
if (a.Length > 3) | |
{ | |
a[0] = 1; | |
a[1] = 2; | |
a[2] = 3; | |
} |
This file contains hidden or 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
name: aws oidc credential with cache | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
# github.job = job name |
This file contains hidden or 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
// oidc provider | |
resource "aws_iam_openid_connect_provider" "main" { | |
url = "https://token.actions.githubusercontent.com" | |
client_id_list = ["sts.amazonaws.com"] | |
thumbprint_list = ["a031c46782e6e6c662c2c87c76da9aa62ccabd8e"] | |
} | |
// role | |
data "aws_iam_policy_document" "github_oid_assume_role_policy" { | |
statement { |
This file contains hidden or 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
# see: https://github.com/guitarrapc/githubactions-lab | |
name: aws oidc credential | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
# allow use id-token | |
permissions: |
This file contains hidden or 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
BenchmarkRunner.Run<BenchmarkLinqWhereFirst>(); | |
[BenchmarkDotNet.Attributes.MemoryDiagnoser] | |
public class BenchmarkLinqWhereFirst | |
{ | |
private readonly int[] data; | |
public BenchmarkLinqWhereFirst() | |
{ | |
data = Enumerable.Range(1, 1000).ToArray(); | |
} |
This file contains hidden or 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
BenchmarkRunner.Run<BenchmarkInterpolatedHandler>(); | |
[BenchmarkDotNet.Attributes.MemoryDiagnoser] | |
public class BenchmarkInterpolatedHandler | |
{ | |
[Benchmark] | |
public void StringInterpolationInline() => PrintAInline(0); | |
[Benchmark] | |
public void StringInterpolationNoInline() => PrintANoInline(0); |
This file contains hidden or 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
BenchmarkRunner.Run<BenchmarkInline>(); | |
[BenchmarkDotNet.Attributes.MemoryDiagnoser] | |
public class BenchmarkInline | |
{ | |
[Benchmark] | |
public void StringInterpolationInline() => PrintAInline(0); | |
[Benchmark] | |
public void StringInterpolationNoInline() => PrintANoInline(0); |
This file contains hidden or 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
# Run on Windwos PowerShell or pwsh. Don't needd Administrator Priviledge | |
# BusType 17 = NVMe, 11 = SATA, 7 = USB. see https://docs.microsoft.com/en-us/previous-versions/windows/desktop/stormgmt/msft-disk | |
Get-CimInstance -namespace Root\Microsoft\Windows\Storage -class msft_physicaldisk | select FriendlyName, BusType |