Skip to content

Instantly share code, notes, and snippets.

View stella6767's full-sized avatar
🎯
Focusing

Kang Min Kyu stella6767

🎯
Focusing
View GitHub Profile
@sombriks
sombriks / example.html
Created June 15, 2024 20:01
hx-dataset-include - keep your application state in the loop using this hacky, fast and simple extension.
<!--
Since the markup IS the application state, using data-* attributes to keep track of some specifics would be handy.
Luckily, HTMX is brutally easy to extend, so we can do that in no time!
-->
<article class="message task"
th:id="'task'+${task.id}"
th:data-task="${task.id}"
th:data-status="${task.status.id}"
th:hx-put="@{/task/{id}(id=${task.id})}"
hx-ext="hx-dataset-include"
@eywu
eywu / golang-templ-cli-on-mac.md
Last active March 15, 2025 03:53
Installing golang Templ CLI on Mac using Nix
@ihoneymon
ihoneymon / 20220627-spring-boot-application-configuration-data-desc.adoc
Last active March 29, 2023 08:27
μŠ€ν”„λ§ λΆ€νŠΈ κ΅¬μ„±νŒŒμΌ 데이터 적재 간단섀λͺ…

μŠ€ν”„λ§ λΆ€νŠΈ ꡬ성속성 이용(Spring Boot External Configuration)

μŠ€ν”„λ§ λΆ€νŠΈμ—μ„œλŠ” μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ ν•„μš”ν•œ 속성을 "μ• ν”Œλ¦¬μΌ€μ΄μ…˜ κ΅¬μ„±νŒŒμΌ" application.yml(ν˜Ήμ€ applicatoin.properties) 에 μž‘μ„±ν•˜μ—¬ ν™œμš©ν•©λ‹ˆλ‹€.

Note

데이터ꡬ쑰λ₯Ό κ³„μΈ΅ν˜•μœΌλ‘œ ν‘œν˜„ν•  수 μžˆμ–΄μ„œ 개인적으둜 .properties 파일 λ³΄λ‹€λŠ” .yml(YAML) 파일 μ΄μš©μ„ μ„ ν˜Έν•©λ‹ˆλ‹€.

[Flyway] Repeatable Migrations & Seed Data

개발 λ‹¨κ³„μ—μ„œ νŽ˜μ΄μ§• 처리 λ“± μ‹œλ“œ 데이터가 ν•„μš”ν•œ κ²½μš°κ°€ λ”λŸ¬ μžˆλ‹€. 이 λ•Œ Flyway μ—μ„œ μ œκ³΅ν•˜λŠ” Repeatable migration 을 ν™œμš©ν•΄ μ‹œλ“œ 데이터λ₯Ό κ΄€λ¦¬ν•˜λ©΄ μ–΄λ–€ 점이 νŽΈν•œ μ§€ 그리고 μœ μ˜ν•  점은 무엇이 μžˆλŠ” μ§€ μ•Œμ•„λ³΄μž.

Repeatable migrations have a description and a checksum, but no version. Instead of being run just once, they are (re-)applied every time their checksum changes.

Repeatable migration 의 κ°€μž₯ 큰 νŠΉμ§•μ€ checksum κ°’ (= λ³€κ²½ μ—¬λΆ€ μ²΄ν¬ν•˜λŠ” κ°’) 이 λ³€κ²½λœ 경우 μ—¬λŸ¬ 번 migration 이 μ μš©λœλ‹€λŠ” 점이닀. SQL-based migration μ—μ„œ Repeatable migration 을 μ‚¬μš©ν•˜κΈ° μœ„ν•΄μ„œλŠ” R__{description}.sql 와 같은 νŒŒμΌμ„ μƒμ„±ν•˜λŠ”λ°, 이미 migration 처리된 νŒŒμΌμ„ μˆ˜μ •ν•˜λ©΄ checksum 값이 λ³€κ²½ λ˜λ©΄μ„œ ν•΄λ‹Ή 파일의 λ‚΄μš©μ΄ λ‹€μ‹œ migration 처리 λŒ€μƒμ΄ λœλ‹€λŠ” 것이닀.

μœ„μ™€ 같은 νŠΉμ§•μœΌλ‘œ λ³„λ„μ˜ 버전 정보λ₯Ό λ”°λ‘œ κ΄€λ¦¬ν•˜μ§€ μ•ŠλŠ”λ‹€.

μ‹œλ“œ 데이터λ₯Ό 관리할 λ•Œ Versioned migration 보닀 Repeatable migration 을 μ‚¬μš©ν•˜λ©΄ νŽΈλ¦¬ν•œ μ΄μœ λ„ μœ„μ—μ„œ μ–ΈκΈ‰ν•œ νŠΉμ§•μ—μ„œ 찾을 수 μžˆλ‹€. Versioned migration 은 버전, 즉 νŠΉμ • μ‹œμ μ˜ μƒνƒœ 정보λ₯Ό κ°€μ§€κ³  있고 λ”°λΌμ„œ λ”± ν•œ 번만 migration μ²˜λ¦¬κ°€ λœλ‹€. λ”°λΌμ„œ μ‹œλ“œ 데이터λ₯Ό Versioned migration 으둜 κ΄€λ¦¬ν•˜λ©΄ μ‹œλ“œ λ°μ΄ν„°μ˜ μΆ”κ°€ 및 μ‚­μ œ μ‹œ 계속 ν•΄μ„œ νŒŒμΌμ„ μƒμ„±ν•΄μ„œ λŒ€μ‘ν•΄μ•Ό ν•œλ‹€.

@rg3915
rg3915 / README.md
Created December 22, 2021 00:11
Alpine.js example
@gunlee01
gunlee01 / FiberTest.java
Created September 20, 2020 13:28
Project Loom, fiber(virtual thread) test generating stack trace.
package gunlee.demo.fiber;
import org.junit.jupiter.api.Test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
@novecentonove
novecentonove / alpineAxios.html
Created July 30, 2020 21:23
Alpine js / Axios Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<title>Alpine and axios</title>
</head>

Two approaches to handle error responses from Spring WebClient calls globally:

  • Exceptions with webclients are all wrapped in WebClientResponseException class. So we can handle that using Spring's ExceptionHandler annotation.

  • Using ExchangeFilterFunction while constructing the webclient bean.

@GamerGirlandCo
GamerGirlandCo / code.md
Created June 15, 2020 18:53 — forked from ChenYCL/code.md
Jetbrains IntelliJ IDEA 2019.2.4 Activation code

Please make fork of this, as this can be removed by Github.com sooner or later.

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsI

With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.

It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.

Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need