Skip to content

Instantly share code, notes, and snippets.

View feuyeux's full-sized avatar
♠️

Lu Han feuyeux

♠️
View GitHub Profile
@feuyeux
feuyeux / HTTP2 learning.md
Last active August 28, 2016 19:33
HTTP2 learning
#!/bin/bash
function a() {
for file in "$1"/*
do
if [ ! -d "${file}" ] ; then
asciidoctor "${file}"
else
traverse "${file}"
fi
done

install thrift

brew install thrift

install gvm

zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
@feuyeux
feuyeux / jna123.md
Last active September 8, 2016 10:27

jna coding

C

myc.c

#include <stdio.h>
int add(int x, int y)
{
  return x+y;
}
#!/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"
╰─○ cat .gitconfig
[user]
name = 六翁
email = lu.hl@***.com
[push]
default = matching
[core]
autocrlf = input
[color]
ui = auto
╰─○ cat .gitconfig
[user]
name = 六翁
email = lu.hl@***.com
[push]
default = matching
[core]
autocrlf = input
[color]
ui = auto
@feuyeux
feuyeux / test_stream_parallel_forkjoin_threadpool.java
Last active March 12, 2019 12:41
test_stream_parallel_forkjoin_threadpool
@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());
@feuyeux
feuyeux / exclusive_or_self-inverse.java
Last active July 24, 2019 00:01
exclusive_or_self-inverse
// 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);
<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>