Skip to content

Instantly share code, notes, and snippets.

@janjaali
janjaali / keybindings.mac.json
Last active May 25, 2022 11:03
VS Code Keybindings (MacOS)
[
// workbench.action.nextEditor (cmd+right)
{
"key": "ctrl+alt+cmd+9",
"command": "-workbench.action.nextEditor"
},
{
"key": "alt+cmd+right",
"command": "-workbench.action.nextEditor"
},
@janjaali
janjaali / FailFastEventSourcedBehavior.scala
Created May 9, 2021 20:06
Behavior that fails fast for persistence failures in EventSourcedBehaviors (i.e. JournalFailureException)
package org.janjaali.akka.persistence.typed.behaviors
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.{ActorRef, Behavior, Terminated}
import akka.pattern.StatusReply
import java.util.UUID
object FailFastEventSourcedBehavior {
@janjaali
janjaali / keybindings.json
Last active June 25, 2022 09:03
VS Code Keybindings (Windows)
[
// workbench.action.nextEditor (alt+right)
{
"key": "alt+right",
"command": "-workbench.action.navigateForward"
},
{
"key": "alt+right",
"command": "-gitlens.key.alt+right",
"when": "gitlens:key:alt+right"
@janjaali
janjaali / settings.json
Last active May 16, 2022 20:59
Windows Terminal settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "clearBuffer",
"clear": "all"
@janjaali
janjaali / .scalafix.conf
Created March 14, 2021 13:24
ScalaFix Organize Imports
// https://github.com/liancheng/scalafix-organize-imports
OrganizeImports {
blankLines = Auto
coalesceToWildcardImportThreshold = 5
expandRelative = false
groupExplicitlyImportedImplicitsSeparately = false
groupedImports = Merge
groups = [
"*"
"java."
@janjaali
janjaali / style.plantuml
Last active February 15, 2021 12:11
PlantUML stylesheet
' Local setup: ' colors
' Store this stylesheet next to you diagrma and include with:
' !include style.plantuml
' Remote setup:
' !include https://gist.githubusercontent.com/janjaali/8c94d1b836ac30fec85595e4c29ac8eb/raw/6d3d94d78db3dd77a3b878708378d181c43fe621/style.plantuml
' colors
!$MAIN = "#176ccb"
!$WHITE = "#ffffff"
@janjaali
janjaali / docker-postgres-snapshot.md
Last active May 31, 2024 15:27
Snapshot instruction for dockerized postgres

Create snapshot of dockerized postgres

The goal of this instruction is to enable users to create Docker images that contain a predefined postgres instance with existing schema and data. We will use the official docker postgres image and mostly docker's own commands.

The first step is to setup a docker container running postgres containing t# Create snapshot of dockerized postgres

The goal of this instruction is to enable users to create Docker images that contain a predefined postgres instance with existing schema and data. We will use the official docker postgres image and mostly docker's own commands.

The first step is to setup a docker container running postgres containing the schema and data that we want to include in the created snapshot:

Creates an "Azure Container Instances" instance

az container create --resource-group {resource_group} `
                    --name {name} `
                    --location westeurope `
                    --image {docker_image} `
                    --os-type Linux `
                    --cpu 1 `
                    --memory 0.5 `
@janjaali
janjaali / azure-cli-cdn.md
Created January 19, 2020 11:05
Little cheatsheet for Azure CDN

Azure Content Delivery Network (CDN)

Create profile

az cdn profile create --resource-group {RESOURCE_GROUP} `
                      --name {PROFILE_NAME} `
                      --location westeurope `
                      --sku Standard_Microsoft
@janjaali
janjaali / azure-cli-postgres.md
Last active April 16, 2020 12:45
Little cheatsheet for Azure Database for PostgreSQL

Create an "Azure Database for PostgreSQL"

az postgres server create --resource-group {resource_group} `
                          --name {server_name} `
                          --admin-user master `
                          --admin-password {password} `
                          --location westeurope `
                          --version 11 `
                          --sku-name B_Gen5_1 `