Skip to content

Instantly share code, notes, and snippets.

View fangzhzh's full-sized avatar
🎯
Focusing

zhangzhenfang fangzhzh

🎯
Focusing
View GitHub Profile
@fangzhzh
fangzhzh / observable-extension.txt
Created June 5, 2018 22:18 — forked from halcyonmobiledev/observable-extension.txt
Data Binding observables and Kotlin
// with just a simple extension function for the Data Binding ObservableField
inline fun <R> ObservableField<R>.observe(crossinline callback: (R) -> Unit) {
this.addOnPropertyChangedCallback(object : Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(p0: Observable?, p1: Int) {
callback(get())
}
})
}
...
@fangzhzh
fangzhzh / introrx.md
Created August 31, 2016 01:18 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@fangzhzh
fangzhzh / simple_args_parsing.sh
Created November 27, 2015 08:54 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@fangzhzh
fangzhzh / log
Last active August 29, 2015 14:26 — forked from zhuomingliang/log
Git
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue<%an>%Creset' --abbrev-commit --date=relative