Skip to content

Instantly share code, notes, and snippets.

View zhangchiqing's full-sized avatar

Leo Zhang zhangchiqing

  • Flow Foundation
  • Vancouver, Canada
View GitHub Profile
@zhangchiqing
zhangchiqing / binarysearch.js
Created April 23, 2017 04:00
simple binary search
var bsearch = function(f, a, b, z) {
if (a + 1 === b) {
return a;
}
var m = Math.floor(( a + b ) / 2);
if (f(m) <= z) {
return bsearch(f, m, b, z);
} else {
return bsearch(f, a, m, z);
}
@zhangchiqing
zhangchiqing / kubectl.md
Created January 31, 2019 05:19
Kubectl cheatsheet