Skip to content

Instantly share code, notes, and snippets.

View douglarek's full-sized avatar

douglarek

View GitHub Profile
package hello;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Base64;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.security.spec.AlgorithmParameterSpec;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class ResponseEntity<T> {
private static final ObjectMapper mapper = new ObjectMapper();
private int code;
@douglarek
douglarek / MyBenchmark.java
Last active March 9, 2021 03:10
java stringBuilder vs stringConcat with JMH
/*
* Copyright (c) 2014, Oracle America, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
@douglarek
douglarek / switchgo.fish
Last active February 18, 2021 08:04 — forked from aofei/switchgo.sh
A fish shell script for switching the version of Go.
function go_switch --argument-names 'verzion' # since version in fish shell is a bulit-in var
if not test -n "$verzion"
echo "Usage: go_switch [version]"
return 1
end
if not type -q go # check bootstrap go
if [ (uname -i) != "x86_64" ]
echo "only x86_64 supported"; and return 1
end
@douglarek
douglarek / org.eclipse.jdt.core.prefs
Created March 22, 2020 04:54
Google style for Eclipse
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
{'traces.vim': {'uri': 'https://git::@github.com/xtal8/traces.vim.git', 'dir': '/Users/lingchax/.vim/plugged/traces.vim/', 'frozen': 0, 'on': [], 'branch': 'master'}, 'nerdcommen
ter': {'uri': 'https://git::@github.com/scrooloose/nerdcommenter.git', 'dir': '/Users/lingchax/.vim/plugged/nerdcommenter/', 'frozen': 0, 'on': '<Plug>NERDCommenterToggle', 'bran
ch': 'master'}, 'vim-signature': {'uri': 'https://git::@github.com/kshenoy/vim-signature.git', 'dir': '/Users/lingchax/.vim/plugged/vim-signature/', 'frozen': 0, 'on': [], 'branc
h': 'master'}, 'auto-pairs': {'uri': 'https://git::@github.com/jiangmiao/auto-pairs.git', 'dir': '/Users/lingchax/.vim/plugged/auto-pairs/', 'frozen': 0, 'on': [], 'branch': 'mas
ter'}, 'vim-multiple-cursors': {'uri': 'https://git::@github.com/terryma/vim-multiple-cursors.git', 'tag': '', 'dir': '/Users/lingchax/.vim/plugged/vim-multiple-cursors/', 'froze
n': 0, 'branch': 'master'}, 'vim-surround': {'uri': 'https://git::@github.com/tpope/vim-surround.git', 'tag': '', 'dir': '/Users/
vim:
./configure --with-features=huge --enable-multibyte --with-tlib=ncurses --enable-cscope --enable-terminal --with-compiledby=Steps --enable-gui=no --without-x --enable-python3interp --enable-luainterp --with-lua-prefix=/usr/local/ --enable-fail-if-missing --prefix=/usr/local --with-luajit
make
make install
macvim:
cd macvim/src
./configure --with-features=huge --enable-multibyte --with-tlib=ncurses --enable-cscope --enable-terminal --with-compiledby=Steps --enable-gui=no --without-x --enable-python3interp --enable-luainterp --with-lua-prefix=/usr/local/ --enable-fail-if-missing --prefix=/usr/local --with-luajit --with-macarchs=x86_64
@douglarek
douglarek / netrw quick reference.md
Created January 30, 2020 05:49 — forked from t-mart/netrw quick reference.md
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
~ $ env GO111MODULE=on go get -x istio.io/istio@1.4.0
go: finding istio.io 1.4.0
# get https://goproxy.cn/istio.io/@v/1.4.0.info
go: finding istio.io/istio 1.4.0
# get https://goproxy.cn/istio.io/istio/@v/1.4.0.info
# get https://goproxy.cn/istio.io/istio/@v/1.4.0.info: 200 OK (0.443s)
# get https://goproxy.cn/istio.io/@v/1.4.0.info: 404 Not Found (0.871s)
# get https://goproxy.cn/k8s.io/apimachinery/@v/v0.0.0.mod
# get https://goproxy.cn/k8s.io/apiextensions-apiserver/@v/v0.0.0.mod
# get https://goproxy.cn/k8s.io/api/@v/v0.0.0.mod
{
"log": {
"loglevel": "warning"
},
"dns": {
"servers": [
"localhost",
"223.5.5.5",
{
"address": "8.8.8.8",