Skip to content

Instantly share code, notes, and snippets.

View Blind-Striker's full-sized avatar

Deniz İrgin Blind-Striker

View GitHub Profile
@Blind-Striker
Blind-Striker / .cs
Created April 27, 2022 23:07
FileStream Benchmarks
[MemoryDiagnoser()]
public class Comparison
{
private const string PathSmall = @"E:\SteamLibrary\steamapps\common\X4 Foundations\extensions\crystal_rarities\subst_01.cat";
private const string PathBig = @"E:\SteamLibrary\steamapps\common\X4 Foundations\02.cat";
private static readonly IFileSystem Fs = new FileSystem();
private static readonly CatalogFileReader CatalogFileReader = new();
private static readonly CatalogFile CatalogFileSmall = CatalogFileReader.GetCatalogFile(PathSmall);
private static readonly CatalogFile CatalogFileLarge = CatalogFileReader.GetCatalogFile(PathBig);
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
oh-my-posh --init --shell pwsh --config C:\Users\deniz\OneDrive\Belgeler\my-posh\material.omp.json | Invoke-Expression
@Blind-Striker
Blind-Striker / settings.json
Created November 6, 2021 18:47
My Windows Terminal Settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
@Blind-Striker
Blind-Striker / .json
Created February 10, 2021 08:49
sample appsettings.Production.json for LocalStack.Net
"LocalStack": {
"UseLocalStack": false
},
"AWS": {
"Profile": "<your aws profile>",
"Region": "eu-central-1"
}
@Blind-Striker
Blind-Striker / .json
Created February 10, 2021 08:48
sample appsettings.Development.json for LocalStack.Net
"LocalStack": {
"UseLocalStack": true,
"Session": {
...
},
"Config": {
...
}
}
@Blind-Striker
Blind-Striker / .json
Created February 10, 2021 08:45
sample appsetting.json for LocalStack.NET
"LocalStack": {
"UseLocalStack": true,
"Session": {
"AwsAccessKeyId": "my-AwsAccessKeyId",
"AwsAccessKey": "my-AwsAccessKey",
"AwsSessionToken": "my-AwsSessionToken",
"RegionName": "eu-central-1"
},
"Config": {
"LocalStackHost": "localhost",
@Blind-Striker
Blind-Striker / .cs
Created February 10, 2021 08:40
Sample DI configuration for LocalStack.NET
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddLocalStack(Configuration)
services.AddDefaultAWSOptions(Configuration.GetAWSOptions());
services.AddAwsService<IAmazonS3>();
services.AddAwsService<IAmazonDynamoDB>();
}
@Blind-Striker
Blind-Striker / serverless.yml
Created August 14, 2019 17:26
Sample for LocalStack article
service: profile
plugins:
- serverless-localstack
custom:
localstack:
host: http://${env:LOCAL_STACK_HOST}
stages:
- local
@Blind-Striker
Blind-Striker / Handler.cs
Last active August 13, 2019 20:45
Sample for LocalStack article
public async Task<APIGatewayProxyResponse> CreateProfileAsync(APIGatewayProxyRequest request, ILambdaContext context)
{
WriteVariables(context);
string requestBody = request.Body;
context.Logger.LogLine($"Request Body\n {requestBody}");
AddProfileModel addProfileModel = JsonConvert.DeserializeObject<AddProfileModel>(requestBody);
context.Logger.LogLine($"Decoding Base64 image");
@Blind-Striker
Blind-Striker / Handler.cs
Created August 13, 2019 20:34
Sample for LocalStack article
public Handler()
{
ISession session = SessionStandalone
.Init()
.WithSessionOptions(AwsAccessKeyId, AwsAccessKey, AwsSessionToken, RegionName)
.WithConfig(LocalStackHost)
.Create();
_awsS3Client = session.CreateClient<AmazonS3Client>();
_awsDynamoDbClient = session.CreateClient<AmazonDynamoDBClient>();