Skip to content

Instantly share code, notes, and snippets.

@DaleLaw
DaleLaw / cantonese-dictionary-privacy-policy.md
Last active September 23, 2019 08:36
Cantonese Dicktionary privacy policy

Privacy Policy

built the 粵典 app as a Free app. This SERVICE is provided by at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at 粵典 unless otherwise defined in this Privacy Policy.

@DaleLaw
DaleLaw / RxOkhttp.kt
Created June 25, 2018 15:10
Wrapping Okhttp with RxJava
object RxOkhttp {
private val client = OkHttpClient()
operator fun get(request: Request): Observable<Response> {
return Observable.defer(Callable<ObservableSource<out Response>> {
try {
val response = client.newCall(request).execute()
return@Callable Observable.just(response)
} catch (e: IOException) {
return@Callable Observable.error<Response>(e)
@DaleLaw
DaleLaw / EventBus.kt
Last active November 2, 2023 15:25
Implement EventBus with Kotlin coroutine
object EventBus {
val bus: BroadcastChannel<Any> = BroadcastChannel()
fun send(o: Any) {
launch {
bus.send(o)
}
}
### Keybase proof
I hereby claim:
* I am dalelaw on github.
* I am lawkinming (https://keybase.io/lawkinming) on keybase.
* I have a public key ASDKFlj2UNiTR2tS06ssQhQHq3wOenL12AZP8nv7GPrHbAo
To claim this, I am signing this object:
<h1>sdksjdflskjdflsdkfjlsd</h1>