Skip to content

Instantly share code, notes, and snippets.

Avatar
♠️

Lu Han feuyeux

♠️
View GitHub Profile
View spring-boot-starter-rsocket-2.2.5.dependencies.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-rsocket</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</exclusion>
<exclusion>
@feuyeux
feuyeux / exclusive_or_self-inverse.java
Last active Jul 24, 2019
exclusive_or_self-inverse
View exclusive_or_self-inverse.java
// Using exclusive or self-inverse to find the repeated number in an array
// Self-inverse: A ⊕ A = 0
// A XOR B XOR B = A XOR 0 = A
int[] a1 = {1, 2, 3, 3};
int[] a2 = {1, 2, 2, 3};
int x1 = a1[0] ^ a1[1] ^ a1[2] ^ a1[3] ^ 1 ^ 2 ^ 3;
int x2 = a2[0] ^ a2[1] ^ a2[2] ^ a2[3] ^ 1 ^ 2 ^ 3;
System.out.println(x1);
System.out.println(x2);
@feuyeux
feuyeux / test_stream_parallel_forkjoin_threadpool.java
Last active Mar 12, 2019
test_stream_parallel_forkjoin_threadpool
View test_stream_parallel_forkjoin_threadpool.java
@Test
public void test() throws InterruptedException, ExecutionException {
ForkJoinPool customThreadPool = new ForkJoinPool(8);
ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("pool-%d").build();
ThreadPoolExecutor executor = new ThreadPoolExecutor(5, Integer.MAX_VALUE,
1, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(5),
threadFactory,
new ThreadPoolExecutor.AbortPolicy());
View .gitconfig
╰─○ cat .gitconfig
[user]
name = 六翁
email = lu.hl@***.com
[push]
default = matching
[core]
autocrlf = input
[color]
ui = auto
View .gitconfig
╰─○ cat .gitconfig
[user]
name = 六翁
email = lu.hl@***.com
[push]
default = matching
[core]
autocrlf = input
[color]
ui = auto
View bash-template.md
#!/usr/bin/env bash
executingPath=$(pwd)
scriptPath=$(cd $(dirname $0);pwd)
scriptParentPath=$(cd $(dirname $0);cd ..; pwd)
scriptName=$(basename $0)

line=$(printf "%-60s")
echo "${line// /#}"
echo "Executing path : $executingPath"
View jna123.md

jna coding

C

myc.c

#include <stdio.h>
int add(int x, int y)
{
  return x+y;
}
View thrift in golang tutorial.md

install thrift

brew install thrift

install gvm

zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
View asciidoctor with traverse
#!/bin/bash
function a() {
for file in "$1"/*
do
if [ ! -d "${file}" ] ; then
asciidoctor "${file}"
else
traverse "${file}"
fi
done
View HTTP2 learning.md