Skip to content

Instantly share code, notes, and snippets.

@hardyscc
hardyscc / win11-setup.md
Last active May 30, 2024 09:16
Windows 11 setup

Windows 11 Setup

Recommended Packages

winget install chrisant996.Clink

winget install Git.Git
winget install GitHub.cli
@hardyscc
hardyscc / spring-boot-stored-proc.md
Created May 21, 2024 04:43
Stored Procedure on Spring Boot

Stored Procedure on Spring Boot

Executing stored procedures in Spring Boot using the @Procedure annotation provides a convenient way to interact with database procedures. By annotating a method with @Procedure and specifying the procedure name, you can easily call stored procedures, pass parameters, and handle result sets, simplifying the integration of stored procedures in your Spring Boot application.

Demostrations

Convert JPA Specification to Stored Procedure

Selected Function to Convert

@hardyscc
hardyscc / docker-on-windows.md
Last active November 2, 2023 04:20
Docker on Windows

Docker on Windows

Ubuntu on WSL

First make sure uninstall all of the old Ubuntu installation under App & Features.

Install Windows Subsystem for Linux under App & Features > Optional features > More Windows features, then

wsl --update
@hardyscc
hardyscc / docker-on-mac.md
Created September 18, 2023 03:57
Docker on Mac

Docker on mac

Colima

brew install colima

Add insecure registry

@hardyscc
hardyscc / CipherHelper.java
Created September 15, 2023 06:24
RSA & AES encryption
package com.example.cipher;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyStore;

Self-hosted Sonarqube

Start Docker Instance

docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest

Generate Token

@hardyscc
hardyscc / install-win11-mac-arm.md
Created July 27, 2023 12:02
install windows 11 on mac m1
brew install --cask utm

brew install cabextract wimlib cdrtools aria2
brew tap minacle/chntpw
brew install minacle/chntpw/chntpw

# download windows 11 arm under https://docs.getutm.app/guides/windows/
cd <unziped_folder>
./uup_download_macos.sh
@hardyscc
hardyscc / class-diagram.md
Last active September 30, 2022 03:36
Sample Class Diagram
classDiagram
    class Order {
        + id: Long
        + status: RecordStatus
        + createDate: Date
        + updateDate: Date
        + version: Long
    }
    class Customer {
set nocompatible " be iMproved, required
filetype off " required
" Auto install VimPlug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
@hardyscc
hardyscc / settings.json
Last active October 13, 2023 07:05
Visual Studio Code Settings
{
"vim.insertModeKeyBindings": [
{
"before": ["j", "k"],
"after": ["<esc>"]
}
],
"vim.startInInsertMode": false,
"files.exclude": {
"**/node_modules": true,