Skip to content

Instantly share code, notes, and snippets.

View y0ngb1n's full-sized avatar
🐝
Fighting

杨斌 Aben y0ngb1n

🐝
Fighting
View GitHub Profile
@y0ngb1n
y0ngb1n / bing-wallpaper-api.md
Last active February 26, 2024 05:57
Bing Wallpaper API
@y0ngb1n
y0ngb1n / CacheRequestBodyGlobalFilter.java
Created June 3, 2022 15:12
自定义 Spring Cloud Gateway 过滤器 GlobalFilter / GatewayFilter
/**
* 缓存请求体全局过滤器
*
* @author yangbin
*/
@Slf4j
@Component
public class CacheRequestBodyGlobalFilter implements GlobalFilter, Ordered {
@Override
@y0ngb1n
y0ngb1n / lombok.config
Created December 15, 2021 10:32
用 Lombok,让 Java 更简洁,使用 lombok.config 全局配置|https://projectlombok.org/features/configuration
##
# https://projectlombok.org/features/configuration
##
config.stopBubbling = true
lombok.accessors.chain=true
lombok.tostring.callsuper=true
lombok.equalsandhashcode.callsuper=true
@y0ngb1n
y0ngb1n / java-custom-thread-pool-executor.md
Last active June 26, 2023 10:00
Java 提供的线程池相关的工具类中,最核心的是 ThreadPoolExecutor,通过名字你也能看出来,它强调的是 Executor,而不是一般意义上的池化资源。

线程池的使用和监控

使用自定义线程池组件,主要思路如下:

  • 使用有界队列的固定数量线程池;
  • 拒绝策略是将任务丢弃,但需要记录错误日志;
  • 使用一个调度线程池对业务线程池进行监控。
import java.util.concurrent.ArrayBlockingQueue;
@y0ngb1n
y0ngb1n / free-time-services.md
Created August 16, 2019 01:33
免费时间服务 NTP / NTS

免费时间服务 NTP / NTS

Cloudflare (NTP、NTS)

NTP: time.cloudflare.com

详细配置:Cloudflare's Time Service

NTS: time.cloudflare.com:1234

@y0ngb1n
y0ngb1n / open-source-web-video-players.md
Created August 15, 2019 04:15
Open Source Web Video Players
@y0ngb1n
y0ngb1n / pom.xml
Last active November 19, 2019 01:23
Awesome Dependencies for Develop.
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.y0ngb1n.awesome</groupId>
<artifactId>awesome-maven-dependencies</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 8, 2024 11:48
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@y0ngb1n
y0ngb1n / maven-mirrors.md
Last active March 4, 2024 02:31
使用公共仓库加速 Maven 构建,提升效率!

国内可用的 Maven 的仓库镜像地址

镜像源 Maven 镜像地址 帮助
阿里云 https://maven.aliyun.com/repository/public 使用文档、提供其他软件源加速
腾讯云 http://mirrors.cloud.tencent.com/nexus/repository/maven-public/ 使用文档、提供其他软件源加速
网易云 http://mirrors.163.com/maven/repository/maven-public/ 使用文档、提供其他软件源加速
华为云 https://repo.huaweicloud.com/repository/maven/ 使用文档、提供其他软件源加速

注:部分镜像源使用多线程下载可能会触发 502 ,重试即可。

# https://editorconfig.org/
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true