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
g10guang /
Last active Oct 1, 2019




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


g10guang / .tmux.conf
Last active Oct 10, 2019
My tmux conf
View .tmux.conf
# cat << EOF > /dev/null
# (‑●‑●)> 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
# -- general -------------------------------------------------------------------
letter = 'abcdefghijklmnopqrstuvwxyz'
import requests, re, collections
# fetch the big.txt to calculate every words probability.
big_text = requests.get("").text
#use regex to match all words and then count their frequency
statistic = collections.Counter(re.findall("\w+", big_text))
g10guang / derivce.cpp
Created Sep 23, 2019
Cpp virtual function testcase
View derivce.cpp
#include <iostream>
using namespace std;
class Base1 {
virtual void f() { cout << "Base1:f" << endl;}
virtual void g() { cout << "Base1::g" << endl;}
g10guang /
Created Sep 16, 2019
A stupid virtual machine.
import enum
class Instruction(enum.Enum):
HLT = 0
ADD = 1
POP = 2
PSH = 3
SET = 4
Get = 5
JMP = 6
View Google protobuf installation on
tar xvf protobuf-2.5.0.tar.bz2
cd protobuf-2.5.0
./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi"
make -j 4 
sudo make install
protoc --version
g10guang /
Last active Aug 11, 2019
sync local code to remote server
prepath=`dirname $PWD`
echo "sshpass -p \"liuxiguang\"rsync -avr --delete ${PWD} phy:/home/liuxiguang/$prepath"
sshpass -p "liuxiguang" rsync -avr --delete --exclude=.git --exclude=.idea --exclude=.vscode --exclude=output ${PWD} phy:/home/liuxiguang/$prepath

show diff between edit file and disk file

:w !diff % -
g10guang / Frequency linux
Last active Feb 14, 2019
Frequency linux command
View Frequency linux

find command with exclude

find -name "*.js" -not -path "./directory/*" -not -path "*thrift_gen/*"

remove duplicate column:

awk '!seen[$0]++' filename
g10guang /
Last active Jan 6, 2019
Python unix time and strftime convert
import time
from datetime import datetime
import pytz

In [14]: t = datetime.fromtimestamp(1546751128, pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S')
In [15]: t
Out[15]: '2019-01-06 13:05:28'
You can’t perform that action at this time.