Skip to content

Instantly share code, notes, and snippets.

View romainbsl's full-sized avatar

Romain Boisselle romainbsl

View GitHub Profile
@romainbsl
romainbsl / CUP-Source-Code-failure.kt
Last active October 14, 2021 12:18
Fails on `«true: // True!»«false: // False!»`
SourceCode(
lang = "kotlin",
code = """
«true: // True!»
""".trimIndent(),
) {
}
@romainbsl
romainbsl / release-repository.sh
Created February 26, 2021 08:18
Sonatype: close and release a staging repository
#!/usr/bin/env bash
username=
password=
stagedRepositoryId=
while [ "$1" != "" ]; do
case $1 in
-u | --username)
shift
@romainbsl
romainbsl / drop-repository.sh
Created February 26, 2021 08:17
Sonatype: drop a staging repository
#!/usr/bin/env bash
username=
password=
stagedRepositoryId=
while [ "$1" != "" ]; do
case $1 in
-u | --username)
shift
@romainbsl
romainbsl / create-repository.sh
Last active March 9, 2021 09:27
Sonatype: create a staging repository and pass it as a Github Action output.
#!/usr/bin/env bash
username=
password=
profileId=
description="Creating staging repository."
while [ "$1" != "" ]; do
case $1 in
-u | --username)
class LoginActivity: AppCompatActivity(), DIAware, LoginView {
override val di by di()
val presenter: LoginPresenter by instance()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
loginButton.setOnClickListener {
presenter.login(secretEditText.text)
}
class LoginActivity: AppCompatActivity(), DIAware {
override val di by di()
// Implementation here
}
class NVBApplication : Application(), DIAware {
override val di by DI.lazy {
import(androidXModule(this@MyApplication))
import(NBVCommonModule)
}
}
...
dependencies {
implementation("org.kodein.sample:nbv-common:1.0.0"))
implementation("'org.kodein.di:kodein-di-framework-android-x:7.0.0")
}
...
import UIKit
import NBVCommon
class LoginViewController: UIViewController, LoginView {
@IBOutlet weak var login_secret: UITextField!
@IBOutlet weak var login_button: UIButton!
let presenter: LoginPresenter! = InjectorCommon.init().provideLoginPresenter()
override func viewWillAppear(_ animated: Bool) {
import UIKit
class LoginViewController: UIViewController {
@IBOutlet weak var login_secret: UITextField!
@IBOutlet weak var login_button: UIButton!
// Using Kotlin/Multiplatform code here!
}