Skip to content

Instantly share code, notes, and snippets.

View hieuvo's full-sized avatar
🎯

Hieu Vo hieuvo

🎯
  • KyberNetwork, exTCB, exGrab, exLazada
  • HCM, Vietnam
  • 05:26 (UTC +07:00)
  • LinkedIn in/hieuvpm
View GitHub Profile
class KMP:
def partial(self, pattern):
""" Calculate partial match table: String -> [Int]"""
ret = [0]
for i in range(1, len(pattern)):
j = ret[i - 1]
while j > 0 and pattern[j] != pattern[i]:
j = ret[j - 1]
ret.append(j + 1 if pattern[j] == pattern[i] else j)
@hieuvo
hieuvo / .gitconfig
Created December 5, 2018 08:39 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
dmerged = "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
st = status
syntax enable
set path=$PWD/**
filetype plugin indent on
set background=dark
colorscheme monokai
colors koehler
autocmd FileType crontab setlocal nowritebackup
set nocompatible
set number
set modelines=0