Skip to content

Instantly share code, notes, and snippets.

Unfortunately Oracle databases aren’t compatible with the new Apple Silicon CPU architecture. Due to this fact you’re not able to run an Oracle XE image with TestContainers on your brand-new MacBook, but there’s a workaround!

TLDR;

Install colima

Run colima start --arch x86_64 --memory 4

Set TestContainers env vars

@kjivan
kjivan / spring-boot-debugging.md
Created March 2, 2024 06:05
Spring Boot Debugging

Spring Boot Debugging

Enable actuators and values

management.endpoints.web.exposure.include=*
management.endpoint.env.show-values=ALWAYS

Enable SQL Logging

@kjivan
kjivan / feature-implementation-best-practices.md
Created February 15, 2024 22:58
Feature Implementation Best Practices

Feature Implementation Best Practices

Debugging Best Practices

Preparation

  • Establish a clear understanding of the issue
    • Ask issue reporter/lead about issue if needed
  • Reproduce the issue
    • Is it a workflow that is causing the issue
    • Is it particular data that is causing the issue
    • Is it a combination of the above
  • Is there a timing issue or a race condition issue
@kjivan
kjivan / error-handling-best-practices.md
Last active July 3, 2024 19:56
Error Handling Best Practices

Error Handling Best Practices

  • System Errors
    • eg null pointers/failed db query/failed api calls
    • Log this at the error level
    • Log stack trace if possible
    • Log any relevant identifiers if possible
    • Don't log any unapproved sensitive data
  • User errors
  • eg invalid zip code/name length
@kjivan
kjivan / logging-best-practices.md
Last active July 3, 2024 19:52
Logging Best Practices

Logging Best Practices

This assumes you have a fast memory logging system.

Use 4 logging levels

  • error - Log critical system errors only (not user errors)
  • warn - Log things that are potential errors or can become errors
  • info(default) - Logs info about events in the system
  • debug - Log more detailed info about debugging
@kjivan
kjivan / github-json.yaml
Created January 24, 2024 15:25
Github JSON
name: Pipeline
on:
push:
jobs:
log-json:
name: Run test command & log github json
runs-on:
- self-hosted
steps:
@kjivan
kjivan / lombok-best-practices.md
Last active February 14, 2024 00:37
Lombok Best Practices

Flaky Test Loop

for i in {1..10}; do
   ./gradlew integrationTest || {echo "Failed after $i attempts" && break}
done
@kjivan
kjivan / github-actions.md
Last active July 14, 2023 20:38
Github Actions

Github Actions

Running github actions repeatedly

gc -m "Whatever" -a; \
gp; \
gh pr create --fill; \
gh pr merge -m