Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Pablo Costa Sottti

🏠
Working from home
View GitHub Profile
View il_unhappy_phone.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="137dp"
android:viewportWidth="307"
android:viewportHeight="210">
<path
android:fillColor="@color/primary_muted_4"
android:pathData="M3.015,159.555c4.818,23.351 13.56,39.078 26.396,48.946l125.117,0.499 147.05,-0.499c5.535,-15.043 5.422,-34.709 5.422,-54.631 0,-71.565 -45.381,-221.37 -159.71,-119.39C96.256,79.998 -20.046,47.787 3.015,159.554z" />
<path
android:fillColor="@color/primary_muted_4"
View ic_driving_license.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="132dp"
android:height="85dp"
android:viewportWidth="132"
android:viewportHeight="85">
<path
android:fillAlpha="0.03"
android:fillColor="@color/primary"
android:pathData="M122.498,84.523L18.361,85c-5.271,0.024 -9.564,-4.268 -9.588,-9.587l-0.259,-57.55c-0.024,-5.318 4.23,-9.65 9.502,-9.674l104.137,-0.476c5.272,-0.024 9.564,4.268 9.588,9.587L132,74.849c0.024,5.319 -4.23,9.65 -9.502,9.674z"
android:strokeAlpha="0.3" />
View il_confetti_pass.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="76dp"
android:viewportWidth="375"
android:viewportHeight="142">
<path
android:fillColor="@color/reni"
android:pathData="M140.407,117.271l-2.842,0.119c1.568,3.405 -0.686,2.409 -0.686,2.409 -3.557,-1.764 -2.09,-3.652 0.862,-5.488l-3.527,-0.469c-3.172,4.412 -4.198,1.801 -4.198,1.801 1.736,-5.19 3.887,-4.97 8.357,-4.281l-5.146,-1.14c-5.282,5.074 -5.837,2.738 -5.837,2.738 3.124,-8.143 8.457,-7.198 13.706,-4.938 -0.929,-3.519 -12.622,-11.07 -8.086,-11.259 2.929,-0.122 15.523,7.598 17.141,20.002 0.165,1.27 21.07,5.05 21.07,5.05l-4.629,8.967 -22.269,-7.195c-4.323,-1.483 -3.916,-6.316 -3.916,-6.316z" />
<path
android:fillColor="@color/primary_muted_5"
View gist:2bbb979109de82a254d474dbf9cf2fbc
Articles:
- [Typesafe Error Handling in Kotlin](https://kotlin.christmas/2019/17)
- [Sealed Classes Instead of Exceptions in Kotlin](https://phauer.com/2019/sealed-classes-exceptions-kotlin/)
- [Kotlin’s Missing Type, Either](https://medium.com/@Robert_Chrzanow/kotlins-missing-type-either-51602db80fda)
Libraries
- https://github.com/michaelbull/kotlin-result
- https://github.com/kittinunf/Result
Discussions
View car_logo_bentley.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="34dp"
android:viewportWidth="100"
android:viewportHeight="34">
<path
android:fillColor="@color/car_logo_fill"
android:pathData="M1.3,2l-1,1s0.2,0.1 0.2,0l0.4,-0.3 0.4,0.3 1.1,0.6 1.3,0.6h1l2.2,0.2L10.7,4.4a162.2,162.2 0,0 0,6 0L22,4.4l1.5,0.1 1.3,0.2 0.3,0.2L25.1,5h0.2l0.1,-0.2 0.1,-0.2v-0.3l-0.7,-0.1A37.8,37.8 0,0 1,21 3a18.2,18.2 0,0 0,-4.7 -0.6L11.3,2.4l-1,-0.1h-1l-0.5,-0.1L8.8,2h2.1L12,2h2.8A116.5,116.5 0,0 1,20 2l1.7,0.4c0.6,0 1.1,0.3 1.8,0.5l2,0.5 1.7,0.1h2.5l3,0.1c0.5,0 3,0.2 3.8,0.4 1.3,0.2 2.6,1.1 2.8,2.2 0.2,1.5 -1.4,3 -1.5,4.4l-0.1,1 -0.3,0.3 0.1,0.2s0,-0.2 0.2,-0.3a14.7,14.7 0,0 1,1.3 -2v-0.7l0.6,-1.2L41,6.7l1,-1c0.2,-0.2 0.5,-0.5 0.6,-0.8 0.2,-0.2 0.2,-0.6 0.2,-0.9l-0.3,-0.6c0,-0.1 0,-0.4 -0.2,-0.5l-0.5,-0.3 -0.3,-0.4 -0.5,-0.1 -1.4,-0.2a39.3,39.3 0,0 0,-9.5 -0.1h-2l-3.7,-0.2 -3,-0.2h-6.8l-2.1,0.2 -2,0.1L5.7,1.7l-1.6,-0.1 -1.8,-0.2h-0.7l-0.4,0.5zM42.1,1.8l-0.6,0.3
View car_logo_porsche.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<group>
<clip-path
android:pathData="M0,0h100v100H0z"/>
<path
android:fillColor="@color/car_logo_fill"
View File.kt
open class User(val userId: Int, val userName: String)
class Editor(userId: Int, userName: String, val rank: Int) : User(userId, userName)
class Moderator(userId: Int, userName: String, val type: Int) : User(userId, userName)
class Staff(userId: Int, userName: String, val department: String) : User(userId, userName)
View OverridenFromAnotherFile.kt
// OverridenFromAnotherFile.kt
// Error: getAge() is not visible because is protected
val userAge = User().getAge()
// Error: getAge() is not visible because inherits the protected modifier
val moderatorAge = Moderator().getAge()
// getAge() is visible because the modifier is declared explicitly as public
val staffAge = Staff().getAge()
View Overridden.kt
// Overridden.kt
public open class User {
protected open fun getAge() = 16
}
public class Moderator : User() {
// getAge() inherits the protected modifier as default
override fun getAge() = 18
}
View ConstructorsVisibility.kt
// User is public
// The User primary constructor is private
class User private constructor(id : Int) {
// ...
}
// Moderator is internal
// The Moderator primary constructor is private
internal Moderator private constructor(id : Int) {
// ...
You can’t perform that action at this time.