This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import org.springframework.stereotype.Service; | |
@Service | |
public class ResponseMap<T> { | |
public Map<String, Object> mapOK(List<T> items) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ScalaArray { | |
def main(args: Array[String]): Unit = { | |
val arrayA = Array(1, 2, 3, 4, 4) | |
for(x <- arrayA) | |
println(x) | |
val arrayB = Array("a", "b", "c", "d") | |
for(x <- arrayB) | |
println(x) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<Integer> fibonacci(int n) { | |
if (n < 0) { | |
throw new IllegalArgumentException("n must not be less than zero"); | |
} | |
if (n == 0) { | |
return new ArrayList<Integer>(); | |
} | |
if (n == 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SERVICE_NAME=SERVICE_NAME # service name | |
PATH_TO_JAR=/home/ec2-user/SERVICE-SNAPSHOT.jar # service jar file | |
PID_PATH_NAME=/tmp/SERVICE_NAME-pid # pid name | |
case $1 in | |
start) | |
echo "Starting $SERVICE_NAME ..." | |
if [ ! -f $PID_PATH_NAME ]; then | |
nohup java -jar -Dspring.profiles.active=dev $PATH_TO_JAR /tmp 2>> /dev/null >> /dev/null & # -Dspring.profiles.active=dev | |
echo $! > $PID_PATH_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:6.11.2 | |
pipelines: | |
default: | |
- step: | |
caches: | |
- node | |
script: | |
- node --version | |
- npm --version | |
- npm install -g gulp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: maven:3-jdk-8 | |
pipelines: | |
default: | |
- step: | |
script: | |
- mvn clean install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stop all containers: | |
docker kill $(docker ps -q) | |
remove all containers | |
docker rm $(docker ps -a -q) | |
remove all docker images | |
docker rmi $(docker images -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://thoeni.io/post/macos-sierra-java/ | |
https://github.com/thoeni/inetTester | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
로그나 바이너리등 git로 관리가 불필요한 파일인데 .gitignore에 추가하는 것을 빼먹고 이미 commit하는 경우 | |
working directory에는 남겨두고 staging area 에서만 삭제해야 하므로 git rm --cached 명령어로 해당 파일을 더 이상 추적하지 않게 하고 | |
다시 commit을 해 준 다음, | |
$ git rm --cached log.txt | |
$ git commit -m 'untrack log.txt' | |
.gitignore에 해당 파일을 추가해 주고 .gitignore도 commit 해 주면 된다. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i | |
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i |
OlderNewer