Skip to content

Instantly share code, notes, and snippets.

View ByungJun25's full-sized avatar

Byungjun Woo ByungJun25

View GitHub Profile
@ByungJun25
ByungJun25 / permanent_alias.md
Created February 19, 2024 21:23
Custom Function for Creating Permanent Alias in Ubuntu

Here is a function named peras that you can add to your ~/.bashrc file:

function peras() {
    local force=0
    if [ "$1" = "-f" ]; then
        force=1
        shift
    fi
@ByungJun25
ByungJun25 / SingletonTemplate.java
Created February 10, 2021 11:28
Singleton boilerplate.
public class SingletonTemplate {
private SingletonTemplate() {
}
public static SingletonTemplate getInstance() {
return SingletonLazyHolder.INSTANCE;
}
private static class SingletonLazyHolder {
private static final SingletonTemplate INSTANCE = new SingletonTemplate();
@ByungJun25
ByungJun25 / Example.java
Last active February 10, 2021 11:52
How to manage a DTO classes with Interface and Inner class
// Entity
@Getter
public class Data {
private UUID id;
private String name;
private String value;
}
// DTO
public interface DataDTO {
@ByungJun25
ByungJun25 / Double_Dispatch_example.java
Last active December 24, 2020 08:52
Double dispatch example.
import java.util.Arrays;
import java.util.List;
public class Main {
public static abstract class Weapon {
protected int attackPoint;
public Weapon(int attackPoint) {
this.attackPoint = attackPoint;
}