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 / SupervisorStrategy.cs
Last active December 17, 2022 17:18
SupervisorStrategy example for Akka.Net Medium Article
protected override SupervisorStrategy SupervisorStrategy()
{
return new OneForOneStrategy(// or AllForOneStrategy
maxNumberOfRetries: 10, // opsiyonel
duration: TimeSpan.FromSeconds(30), // opsiyonel
decider: x =>
{
// ArithmeticException Actor durduracak kadar kritik bir hata değil
// dolayısıyla devam etmesinde bir sakınca yok.
if (x is ArithmeticException) return Directive.Resume;
@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 / docker-compose-localstack.yml
Last active October 17, 2019 18:26
LocalStack docker-compose file for Windows
version: '2.1'
services:
localstack:
privileged: true
image: localstack/localstack:0.10.1.2
ports:
- '4567-4585:4567-4585'
- '4590-4593:4590-4593'
- '${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}'
@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