ssh-keygen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set incsearch | |
set hls | |
set smartcase | |
set ignorecase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
letter = 'abcdefghijklmnopqrstuvwxyz' | |
import requests, re, collections | |
# fetch the big.txt to calculate every words probability. | |
big_text = requests.get("http://norvig.com/big.txt").text | |
#use regex to match all words and then count their frequency | |
statistic = collections.Counter(re.findall("\w+", big_text)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Base1 { | |
public: | |
virtual void f() { cout << "Base1:f" << endl;} | |
virtual void g() { cout << "Base1::g" << endl;} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import enum | |
class Instruction(enum.Enum): | |
HLT = 0 | |
ADD = 1 | |
POP = 2 | |
PSH = 3 | |
SET = 4 | |
Get = 5 | |
JMP = 6 |
wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
prepath=`dirname $PWD` | |
# make sure both mac & devbox satisfy, $GOPATH=$HOME/go | |
myhome="${HOME}/" | |
prepath=${prepath:${#myhome}} | |
# set your own devbox username, mine is liuxiguang | |
devboxusername="liuxiguang" | |
sshpass -p ${devboxusername} rsync -avr --delete --exclude=test.go --exclude=.idea --exclude=.vscode --exclude=output ${PWD} dev:/home/${devboxusername}/$prepath | |
echo $(date -u +"%Y-%m-%d %H:%M:%S%Z") |