Skip to content

Instantly share code, notes, and snippets.

View xuanyu-h's full-sized avatar
🎯
Focusing

xuanyu xuanyu-h

🎯
Focusing
  • Shanghai
View GitHub Profile
@xuanyu-h
xuanyu-h / SnakeCaseApplicationConfiguration.java
Created March 12, 2020 07:52 — forked from azhawkes/SnakeCaseApplicationConfiguration.java
Spring Boot: convert inbound parameters from snake_case to camelCase
@Configuration
public class SnakeCaseApplicationConfiguration {
@Bean
public OncePerRequestFilter snakeCaseConverterFilter() {
return new OncePerRequestFilter() {
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
final Map<String, String[]> parameters = new ConcurrentHashMap<>();
for (String param : request.getParameterMap().keySet()) {
@xuanyu-h
xuanyu-h / CourseCode.java
Created December 2, 2019 12:18 — forked from darbyluv2code/CourseCode.java
Spring MVC Validation - FAQ: Is it possible to integrate multiple validation string in one annotation?
package com.luv2code.springdemo.mvc.validation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
@xuanyu-h
xuanyu-h / gist:a3479b39a6e922f8b0f6b105d7a9b85b
Created January 24, 2019 03:09 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
# Ruby Thread Pool
# ================
# A thread pool is useful when you wish to do some work in a thread, but do
# not know how much work you will be doing in advance. Spawning one thread
# for each task is potentially expensive, as threads are not free.
#
# In this case, it might be more beneficial to start a predefined set of
# threads and then hand off work to them as it becomes available. This is
# the pure essence of what a thread pool is: an array of threads, all just
# waiting to do some work for you!
@xuanyu-h
xuanyu-h / haproxy.conf
Created April 8, 2018 08:24 — forked from thpham/haproxy.conf
test config haproxy for gRPC loadbalancing
global
tune.ssl.default-dh-param 1024
defaults
timeout connect 10000ms
timeout client 60000ms
timeout server 60000ms
frontend fe_http
mode http
@xuanyu-h
xuanyu-h / git-branch.md
Created March 23, 2017 03:07 — forked from yisibl/git-branch.md
在Mac、Linux 终端显示 Git 当前所在分支

在Mac、Linux 终端显示 Git 当前所在分支

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件