Skip to content

Instantly share code, notes, and snippets.

View 0532's full-sized avatar
🇨🇳

wanglichao 0532

🇨🇳
View GitHub Profile
@0532
0532 / install.sh
Last active December 30, 2023 09:02
Linux一键安装,卸载JDK8、Tomcat8脚本
#!/bin/bash
#
###############################################
#author: 0532
#email: wanglichao@163.com
#date: 2016-06-16
###############################################
base_dir=$(cd "$(dirname "$0")";pwd)
@0532
0532 / 1.html
Created April 14, 2015 03:54
github button 'star' 'fork' 'fellow' and 'fork me on github'
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="gh-fork-ribbon.css">
<link rel="stylesheet" href="style.css" />
<style>
.right .github-fork-ribbon {
background-color: #333;
}
</style>
@0532
0532 / convert.js
Created April 10, 2015 04:00
You can use this to convert a DOM element or a HTML string to markdown.
/*
You can use this to convert a DOM element or a HTML string to markdown.
Usage examples:
var markdown = toMarkdown(document.getElementById("content"));
// With jQuery you can easily convert HTML strings
var markdown = toMarkdown($("<ul><li>Hi!</li></ul>")[0]);
@0532
0532 / git.alias
Last active November 18, 2021 12:48
git 命令常用别名,配置在.gitconfig文件下
[alias]
s = status
st = status
sb = status -s -b
#############
d = diff
di = diff
dc = diff --cached
dk = diff --check
dck = diff --cached --check
@0532
0532 / giteio.properties
Last active October 20, 2021 11:41
giteio.properties
gate.io.query.url=https://data.gateio.ws
@0532
0532 / quicksort
Created October 10, 2014 02:50
Javascript recursive quicksort
function quickSort(A) {
var smaller = []; var larger = [];
if (A.length <= 1)
return A;
for (var i = 1; i < A.length; i++) {
if (A[i] < A[0])
smaller.push(A[i]);
if (A[i] >= A[0])
larger.push(A[i]);
@0532
0532 / channel_v3.json
Created March 26, 2019 01:23
解决sublime text 3使用Install Package时出现There are no packages available for installation问题
This file has been truncated, but you can view the full file.
{"schema_version": "3.0.0", "repositories": ["https://bitbucket.org/jjones028/p4sublime/raw/tip/packages.json", "https://bitbucket.org/klorenz/sublime_packages/raw/tip/packages.json", "https://packagecontrol.io/packages_2.json", "https://packagecontrol.io/repository.json", "https://packages.monokai.pro/packages.json", "https://raw.githubusercontent.com/20Tauri/DoxyDoxygen/master/DoxyDoxygen.json", "https://raw.githubusercontent.com/Andr3as/Sublime-SurroundWith/master/packages.json", "https://raw.githubusercontent.com/FichteFoll/sublime_packages/master/package_control.json", "https://raw.githubusercontent.com/Floobits/floobits-sublime/master/packages.json", "https://raw.githubusercontent.com/Harrison-M/indent.txt-sublime/master/packages.json", "https://raw.githubusercontent.com/Hexenon/FoxCode/master/packages.json", "https://raw.githubusercontent.com/Kaizhi/SublimeUpdater/master/packages.json", "https://raw.githubusercontent.com/Kasoki/FancyProjects/master/packages.json", "https://raw.githubusercontent.com/Mat
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Queue;
import java.util.concurrent.*;
/**
* 线程池管理
*/
@0532
0532 / FingerPrintFeignconfig.java
Created January 9, 2019 03:32
feign请求copy 请求头,使用方法@FeignClient(url = "${feign.url.internal.securityService}", name = "deviceFingerPrintFeign" , configuration = FingerPrintFeignconfig.class)
@Configuration
public class FingerPrintFeignconfig implements RequestInterceptor {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
public void apply(RequestTemplate template) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
@0532
0532 / show-busy-java-threads.sh
Created December 21, 2018 04:35
显示当期服务器占用线程数 sh show-busy-java-threads.sh -p PID
#!/bin/bash
# @Function
# Find out the highest cpu consumed threads of java, and print the stack of these threads.
#
# @Usage
# $ ./show-busy-java-threads
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/master/docs/java.md#-show-busy-java-threads
# @author Jerry Lee (oldratlee at gmail dot com)
# @author superhj1987 (superhj1987 at 126 dot com)