Skip to content

Instantly share code, notes, and snippets.

View amitkumar0000's full-sized avatar
🌴
kotlin

Amit kumar amitkumar0000

🌴
kotlin
  • Zeta
  • bangalore
View GitHub Profile
[
{
"Title": "Avatar",
"Year": "2009",
"Rated": "PG-13",
"Released": "18 Dec 2009",
"Runtime": "162 min",
"Genre": "Action, Adventure, Fantasy",
"Director": "James Cameron",
"Writer": "James Cameron",
@amitkumar0000
amitkumar0000 / 1 - ci.yml
Created September 17, 2023 02:53 — forked from tfcporciuncula/1 - ci.yml
Keeping a project dependency graph on the README up to date automatically by always generating it on CI with a GitHub Action
generate-dependency-graph:
name: Generate Dependency Graph
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
@amitkumar0000
amitkumar0000 / SDK to APP communication
Created January 31, 2022 18:12
Producing party to consuming party communication
class SDKModule {
private fun requestReactHost(listener: ContainerListener) {
listener.onRequest(object: AppListener {
override fun onResponse(reactHost: String) {
Timber.d("Got the response: $reactHost")
}
})
}
@amitkumar0000
amitkumar0000 / RxImmediateSchedulerRule.kt
Created December 30, 2021 18:33 — forked from starkej2/RxImmediateSchedulerRule.kt
RxJava Immediate Scheduler Test Rule
/**
* Replaces the default RxJava schedulers with a synchronous one.
*/
class RxImmediateSchedulerRule : TestRule {
private val immediateScheduler = object : Scheduler() {
@NonNull
override fun scheduleDirect(run: Runnable, delay: Long, unit: TimeUnit): Disposable {
// Hack to prevent stack overflows in unit tests when scheduling with a delay;
return super.scheduleDirect(run, 0, unit)
}
import UIKit
class FloatingButtonController: UIViewController {
private(set) var button: UIButton!
required init?(coder aDecoder: NSCoder) {
fatalError()
}