Skip to content

Instantly share code, notes, and snippets.

View hongchaodeng's full-sized avatar
👋
Anyscale is hiring! Send your resume to hongchao.deng@anyscale.com

Hongchao Deng hongchaodeng

👋
Anyscale is hiring! Send your resume to hongchao.deng@anyscale.com
View GitHub Profile
@hongchaodeng
hongchaodeng / cinnamon_animation_speed.md
Last active August 29, 2015 14:01
Cinnamon animation speed up
$ sudo vim /usr/share/cinnamon/js/ui/overview.js

There is a ANIMATION_TIME variable inside..

@hongchaodeng
hongchaodeng / git_rebase
Last active August 29, 2015 14:02
Old commits in git rebase
Let's say I have two branches
- master
- topic
They looks like:
D - E - F - A - G (master)
\
- B - A' - C (topic, where A' is cherry-picked from master)
@hongchaodeng
hongchaodeng / git_mergetool_fugitive.txt
Last active August 29, 2015 14:03
git mergtool set to fugitive
git config --global mergetool.fugitive.cmd 'gvim -f -c "Gdiff" "$MERGED"'
git config --global merge.tool fugitive
@hongchaodeng
hongchaodeng / osx_internet.md
Last active August 29, 2015 14:03
osx speed up

remove everything under

rm -rf /Library/Preferences/SystemConfiguration

@hongchaodeng
hongchaodeng / osx_protoc.md
Created July 7, 2014 01:45
OSX protoc version

OSX homebrew can install protobuf. But the default is protobuf 2.5 at the time. All you have to do is to type the following after install protobuf241.

brew link --force --overwrite protobuf241

@hongchaodeng
hongchaodeng / error.log
Created February 7, 2015 04:23
etcd cluster test
? github.com/go-distributed/meritop [no test files]
=== RUN TestControllerInitEtcdLayout
2015/02/06 20:22:32 etcdserver: name = controller_test
2015/02/06 20:22:32 etcdserver: data dir = /var/folders/6g/r7fwqcld2s95n7p8hx5pdbl40000gp/T/etcd902684176
2015/02/06 20:22:32 etcdserver: heartbeat = 10ms
2015/02/06 20:22:32 etcdserver: election = 100ms
2015/02/06 20:22:32 etcdserver: snapshot count = 0
2015/02/06 20:22:32 etcdserver: advertise client URLs = http://127.0.0.1:64518
2015/02/06 20:22:32 etcdserver: initial advertise peer URLs = http://127.0.0.1:64517
2015/02/06 20:22:32 etcdserver: initial cluster = controller_test=http://127.0.0.1:64517
@hongchaodeng
hongchaodeng / interface.go
Last active January 30, 2016 19:02
schedulercache interface.go
package schedulercache
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/labels"
)
// Cache collects pods' information and provides node-level aggregated information.
// It's intended for generic scheduler to do efficient lookup.
type Storage interface {
// Put...
// if prevVersion < 0, we will set the object with current largest resource version,
// put the object on the key, and returns the stored object.
// If prevVersion >= 0, we will use it to do Compare-And-Swap against existing object's resource version.
// Note that prevVersion = 0 means no previous object on given key.
// - If compare failed, it will return current object (nil if non-exist) and StorageError of VersionConflicts.
// - If compare succeed, it will behave like "prevVersion < 0".
Put(key string, obj runtime.Object, prevVersion int64) (cur runtime.Object, err error)
type Interface interface {
// Put puts an object on a key.
// if prevVersion < 0, we will set the object with current largest resource version,
// put the object on the key, and returns the stored object.
// If prevVersion >= 0, we will use it to do Compare-And-Swap against existing object's resource version.
// Note that prevVersion = 0 means no previous object on given key.
// - If compare failed, it will return current object (nil if non-exist) and StorageError of VersionConflicts.
// - If compare succeed, it will behave like "prevVersion < 0".
@hongchaodeng
hongchaodeng / latency.go
Created September 17, 2016 00:00
watch response latency
package main
import (
"flag"
"fmt"
"os"
"runtime"
"sync/atomic"
"time"