Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tieubao on github.
  • I am nntruonghan (https://keybase.io/nntruonghan) on keybase.
  • I have a public key whose fingerprint is 672F 6845 AD46 358A A356 544D 890D 921B CBBE 6479

To claim this, I am signing this object:

@tieubao
tieubao / latency.txt
Created January 31, 2017 19:49 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
@tieubao
tieubao / xcode-build-bump.sh
Created November 14, 2016 17:03 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@tieubao
tieubao / codeship-elixir.sh
Created July 7, 2016 10:39 — forked from paulgoetze/codeship-elixir.sh
Codeship Elixir/Phoenix test setup
#!/bin/bash
# Erlang
ERLANG_VERSION=${ERLANG_VERSION:-19.0}
ERLANG_CACHED_DOWNLOAD="${HOME}/cache/OTP-${ERLANG_VERSION}.tar.gz"
ERLANG_DIR=${ERLANG_DIR:="$HOME/erlang"}
# Elixir
ELIXIR_VERSION=${ELIXIR_VERSION:-1.3.1}
ELIXIR_CACHED_DOWNLOAD="${HOME}/cache/elixir-v${ELIXIR_VERSION}.zip"
@tieubao
tieubao / Procfile
Created July 5, 2016 12:10 — forked from mustafaturan/Procfile
Configurations for Phoenix Framework 'Deploy To Heroku' button
web: MIX_ENV=prod mix phoenix.server
@tieubao
tieubao / PULL_REQUEST_TEMPLATE.md
Created March 6, 2016 20:15
Pull Request Template that inspired by QuickLeft

Status

READY / IN DEVELOPMENT / HOLD

What's this PR do?

Where should the reviewer start?

How should this be manually tested?

@tieubao
tieubao / pull-request-template.md
Created March 6, 2016 20:06 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Status

READY/IN DEVELOPMENT/HOLD

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

@tieubao
tieubao / cucumbertables.vim
Created February 3, 2016 12:10 — forked from MaienM/cucumbertables.vim
Auto-align on equal signs (=) using Tabularize.
inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a
function! s:ealign()
let p = '^.*=\s.*$'
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
Tabularize/=/l1
normal! 0
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endif
@tieubao
tieubao / ledis.md
Created December 6, 2015 16:50 — forked from minhnhdo/ledis.md

Update (10am)

  • RPUSH, SADD needs to support multiple values
  • Command names are case-insensitive, parameter and values are case-sensitive and must be all lowercase.
  • If a command doesn't specify return value, please return OK if successful, or follow the error code.
  • Updated sample tests (see link in the sample tests section)
  • SET will always overwrite the value for that key

Grokking Challenge Finale