Skip to content

Instantly share code, notes, and snippets.

View DeppWang's full-sized avatar
🎯
Focusing

Depp Wang DeppWang

🎯
Focusing
View GitHub Profile
@DeppWang
DeppWang / README.md
Created March 8, 2023 11:56 — forked from denji/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@DeppWang
DeppWang / .zsh_aliases.md
Created March 3, 2021 06:56
macOS 配置命令别名(简写)

新建文件 ~/.zsh_aliases

# Git
alias gaa='git add .'
alias gst='git status'
alias gl='git pull'
alias gp='git push'
alias gpf='git push -f'
alias gd='git diff | mate'
@DeppWang
DeppWang / MatchUtil.java
Last active October 16, 2020 03:50
Java 工具类,判断空数据
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class MatchUtil {
public MatchUtil() {
}
public static boolean isEmpty(Object obj) {
@DeppWang
DeppWang / articleid.md
Last active April 13, 2020 15:31
一个上传本地指定文件夹最近修改文章到 ArtiPub 的脚本

null

@DeppWang
DeppWang / Server.java
Created April 3, 2020 02:41
A sample HTTP Server in Java, Use ServerSocket implement, code from https://www.liaoxuefeng.com/wiki/1252599548343744/1304265903570978
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
@DeppWang
DeppWang / removeListDuplicates
Last active May 19, 2019 12:47
去除List中重复元素
List<String> configurations = getCandidateConfigurations(annotationMetadata,attributes);
configurations = removeDuplicates(configurations);
protected final <T> List<T> removeDuplicates(List<T> list) {
return new ArrayList<>(new LinkedHashSet<>(list));
}
@DeppWang
DeppWang / roundDownDouble
Last active May 7, 2019 02:16
Double数值默认下舍入保留一位小数,直接舍弃掉1位小数后的值
private Double roundDownDouble(Double value) {
BigDecimal b = new BigDecimal(String.valueOf(value));//BigDecimal(String val)可控,BigDecimal(double val)不可预测。(BigDecimal:不可变的,任意精度带符号的十进制数)
return b.setScale(1, BigDecimal.ROUND_DOWN).doubleValue();//下舍入
}