Skip to content

Instantly share code, notes, and snippets.

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@bytedaring
bytedaring / switchgo.sh
Created October 9, 2021 06:15 — forked from aofei/switchgo.sh
A shell script for switching the version of Go.
function switchgo() {
version=$1
if [ -z $version ] || [ $# -ne 1 ]; then
echo "Usage: switchgo [version]"
return 1
fi
if [ -z $GOBIN ]; then
echo "\$GOBIN is not set"
return 1
@bytedaring
bytedaring / README.md
Created November 6, 2020 02:23 — forked from rhamedy/README.md
Configure HikariCP with Spring Boot JPA Hibernate and PostgreSQL as a database

I came across HikariCP and I was amazed by the benchmarks and I wanted to try it instead of my default choice C3P0 and to my surprise I struggled to get the configurations right probably because the configurations differ based on what combination of tech stack you are using.

I have setup Spring Boot project with JPA, Web, Security starters (Using [Spring Initializer][1]) to use PostgreSQL as a database with HikariCP as connection pooling.
I have used Gradle as build tool and I would like to share what worked for me for the following assumptions:

  1. Spring Boot Starter JPA (Web & Security - optional)
  2. Gradle build tool
  3. PostgreSQL running and setup with a database (i.e. schema, user, db)

This gist is related to SO post https://stackoverflow.com/questions/26490967/how-do-i-configure-hikaricp-in-my-spring-boot-app-in-my-application-properties-f

@bytedaring
bytedaring / GitConfigHttpProxy.md
Created September 28, 2019 02:05 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@bytedaring
bytedaring / mgoTestExample.go
Created March 21, 2019 06:45 — forked from laeshiny/mgoTestExample.go
mgo test example
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Content struct {
@bytedaring
bytedaring / golang_nginx.txt
Created December 27, 2016 08:00 — forked from ifels/golang_nginx.txt
通过nginx反向代理go语言写的http服务器
通过nginx反向代理go语言写的http服务器
1. nginx 配置
#列出所有服务器地址,nginx 自动均衡分发请求到各个服务器。
upstream frontends {
ip_hash;
server 192.168.199.1:8088;
server 192.168.199.2:8089;
}
server {
listen 80;