Skip to content

Instantly share code, notes, and snippets.

View wangsquirrel's full-sized avatar
๐Ÿ’ญ
๐Ÿค”

Wรกng Sลng wangsquirrel

๐Ÿ’ญ
๐Ÿค”
  • freewheel.tv
  • Beijing, China
View GitHub Profile
@wangsquirrel
wangsquirrel / latency.txt
Created April 3, 2019 02:38 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@wangsquirrel
wangsquirrel / .vimrc
Created December 24, 2018 08:57
vimrc
set ts=4
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
syntax on
set nu!
set hlsearch
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
@wangsquirrel
wangsquirrel / speed_test.py
Last active April 4, 2019 03:55
test vultr speed
#!/usr/bin/python2.7
#pip install pyping requests
import pyping
import requests
import sys
import time
import math
vultr_addrs = ["fra-de-ping.vultr.com", "ams-nl-ping.vultr.com", "par-fr-ping.vultr.com",
"lon-gb-ping.vultr.com", "sgp-ping.vultr.com", "hnd-jp-ping.vultr.com",
@wangsquirrel
wangsquirrel / gist:d060aba16640cab551bdbccd1b77e768
Created August 9, 2018 10:41 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@wangsquirrel
wangsquirrel / setup.sh
Last active April 1, 2025 08:44
deploy ss server from a new created vm
#!/bin/bash
# Usage: bash <(curl -s https://gist.githubusercontent.com/wangsquirrel/74b0425bc3ef52821b3d12a7d4abdc24/raw/4d6f0d58a1daa56ee1ded1761a2224912a3b619d/setup.sh) 6666 aaaa
set -ex
PORT=$1
PASSWD=$2
cd ~
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
yum -y install python-setuptools net-tools vim yum-utils
echo "export PATH=/usr/local/openresty/nginx/sbin:$PATH" >> ~/.bash_profile