Skip to content

Instantly share code, notes, and snippets.

View projected1's full-sized avatar
๐Ÿ˜Ž
Coding

Daniel Gorbatov projected1

๐Ÿ˜Ž
Coding
View GitHub Profile
@projected1
projected1 / formatException.java
Created February 2, 2021 12:21
Unwinds Java exception stack and converts it to a formatted string.
/**
* Unwinds Java exception stack and converts it to a formatted string.
*
* e.g.
*
* Exception in thread "main"
* java.lang.RuntimeException: java.lang.RuntimeException: test
* at com.example.Main.foo(Main.java:50)
* at com.example.Main.test(Main.java:40)
* at com.example.Main.main(Main.java:14)
@projected1
projected1 / spring-transactions.md
Created March 2, 2021 23:33
Transactions management and configuration in the Spring framework.

Spring Transactions

JTA (Java Transaction API) Transaction Management

Transaction synchronization is the process by which a persistence context is registered with a transaction so that the persistence context can be notified when a transaction commits. The provider uses this notification to ensure that a given persistence context is correctly flushed to the database.

Transaction association is the act of binding a persistence context to a transaction. You can also think of this as the

@projected1
projected1 / intellij-shortcuts.md
Created April 22, 2021 06:43
Keyboard shortcuts for IntelliJ.

IntelliJ Keyboard Shortcuts

Command Description
Shift x2 Search anywhere
Ctrl x2 Run anything
Ctrl N Open any class
Ctrl Shift N Open any file
Alt F7 Find references
Alt J Quick search and replace
@projected1
projected1 / mongodb-reference.md
Last active March 24, 2022 11:54
MongoDB reference.

MongoDB

Command-Line Reference

Start Mongo shell

$ mongo
@projected1
projected1 / git-reference.md
Last active June 16, 2021 20:20
Git reference.
@projected1
projected1 / amazon-s3-upload.md
Last active May 16, 2021 11:20
Uploading Files to Amazon S3 using Node.js & AWS SDK.

Uploading Files to Amazon S3

There is a specific way to upload files to Amazon S3. Unlike the traditional client-server approach, the client does not need to send any actual files to the server. Instead, the client asks the server for a pre-signed URL to an Amazon S3 bucket and then uploads the files directly to S3. If the client wants to upload multiple files, it needs to get a separate pre-signed URL for each and every file.

Installing the AWS CLI

Visit the AWS CLI web page and follow the installation instructions for our operating system.

The AWS CLI is currently available on:

@projected1
projected1 / gitlab-ssh-config.md
Last active April 4, 2025 07:30
GitLab SSH Configuration.

GitLab SSH Config

This tutorial will help you to configure your GitLab SSH keys. Once configured, you should be able to clone repositories, push your changes and submit your pull requests to GitLab repositories via SSH.

Unless otherwise noted, all instructions are for the Window environment. If you are looking for instructions for Linux or MAC OS, please consult the official documentation instead.

Generating a New SSH Key

If not already installed, install Git for Windows.

@projected1
projected1 / aws-cli.md
Last active July 13, 2023 16:00
AWS CLI reference.

AWS CLI V2

accessanalyzer

  • apply-archive-rule
  • cancel-policy-generation
  • create-access-preview
  • create-analyzer
  • create-archive-rule
  • delete-analyzer
  • delete-archive-rule
@projected1
projected1 / aws-cli-cheat-sheet.md
Last active February 10, 2025 03:45
AWS CLI cheat sheet.
@projected1
projected1 / aws-principals.md
Created June 20, 2021 22:15
AWS service principals.