Skip to content

Instantly share code, notes, and snippets.

View myoungpyohong's full-sized avatar

Myoungpyo, Hong myoungpyohong

View GitHub Profile
plugins {
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'idea'
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
id "io.franzbecker.gradle-lombok" version "3.2.0"
}
@myoungpyohong
myoungpyohong / macos-ramdisk.md
Created September 10, 2020 09:56 — forked from htr3n/macos-ramdisk.md
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@myoungpyohong
myoungpyohong / frontend-ws-connection.ts
Created September 11, 2020 10:14 — forked from jsdevtom/frontend-ws-connection.ts
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
@myoungpyohong
myoungpyohong / CoolSMSRetrofitExample.java
Last active February 23, 2021 07:29
CoolSMS Retrofit Example
// create 6-digit
public int create6digit() {
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
int verificationNumber = sr.nextInt(900000) + 100000;
}
@Configuration
public class RetrofitConfig {
// get aes256 key : https://asecuritysite.com/encryption/keygen
fun String.encrypt(secret: String): String {
val keyData = secret.toByteArray()
val ivData = secret.substring(0, 16).toByteArray()
val aesKey = SecretKeySpec(keyData, "AES")
val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding")
cipher.init(Cipher.ENCRYPT_MODE, aesKey, IvParameterSpec(ivData))
return String(Base64.getEncoder().encode(cipher.doFinal(this.toByteArray())))
}