Skip to content

Instantly share code, notes, and snippets.

View biratrai's full-sized avatar
🎯
Focusing on 100 Days Of Code

Birat Rai biratrai

🎯
Focusing on 100 Days Of Code
View GitHub Profile
@Iamsdt
Iamsdt / MainActivity.kt
Last active April 27, 2020 01:27
Dependency Injection with KOIN to Androidx (WorkManager and ViewModel)
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer
import kotlinx.android.synthetic.main.activity_main.*
import org.koin.androidx.viewmodel.ext.android.viewModel
class MainActivity : AppCompatActivity() {
private val viewModel: MainVM by viewModel()
@mauricegavin
mauricegavin / build.gradle
Last active February 22, 2019 17:21
Using Checkstyle's maxErrors with Gradle
task checkstyle(type: Checkstyle) {
configFile rootProject.file('checkstyle.xml')
configFile file("${project.rootDir}/code_quality_tools/checkstyle.xml")
ignoreFailures true // Uncomment to fail where warnings > 0
showViolations true
source 'src'
include '**/*.java''
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@dodyg
dodyg / gist:5616605
Last active November 21, 2022 03:05
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")