Skip to content

Instantly share code, notes, and snippets.

🤑
Running On My Way

Larry Liu g10guang

🤑
Running On My Way
Block or report user

Report or block g10guang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View go_update_package.md

govendor

govendor fetch github.com/nsqio/go-nsq/...

go mod

go get github.com/nsqio/go-nsq@v1.0.7
@g10guang
g10guang / socket_fork.py
Last active Feb 1, 2020
python code create socket reuseaddr with subprocess and reuseaddr + reuseport
View socket_fork.py
import os
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
print('create socket')
s.bind(('0.0.0.0', 19823))
View useful_git_cmd.md

Remove untrace file.

git clean -fd
@g10guang
g10guang / remove_html_tag.go
Created Jan 18, 2020
golang remove html tag from string
View remove_html_tag.go
package utils
import (
"regexp"
"sort"
"strings"
)
// match html tag and replace it with ""
func RemoveHtmlTag(in string) string {
View install-mongo-shell.sh
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt update
sudo apt install -y --allow-unauthenticated mongodb-org-shell
View .mongorc.js
// pretty print for find()
DBQuery.prototype._prettyShell = true
@g10guang
g10guang / config_linux.md
Created Nov 25, 2019
config my new linux
View config_linux.md

ssh

config github/gitlab ssh key

ssh-keygen

ssh login with public key

@g10guang
g10guang / .ideavimrc
Created Oct 30, 2019
JetBrains .ideavimrc
View .ideavimrc
set incsearch
set hls
set smartcase
set ignorecase
@g10guang
g10guang / choose_app.md
Last active Oct 1, 2019
符号的伟大
View choose_app.md

符号的伟大

连接目标和美好事物,喂养用户强大的大脑。

国庆回家发现家人连接着wifi,在刷今日头条、抖音,百度一下知识点,这一场景引发了我的一些思考,以下做个简单的分享:

  1. 品牌传递给用户的价值是非常重要的
  2. 将产品和美好事物或代名词做绑定有助于用户做选择
  3. 长期博弈下,真正优秀的产品才能留住用户

来几个口号:

@g10guang
g10guang / .tmux.conf
Last active Jan 8, 2020
My tmux conf
View .tmux.conf
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------
You can’t perform that action at this time.