Skip to content

Instantly share code, notes, and snippets.

Avatar
🎉
Mostly Android stuff now, also FP

Jorge Castillo JorgeCastilloPrz

🎉
Mostly Android stuff now, also FP
View GitHub Profile
@JorgeCastilloPrz
JorgeCastilloPrz / ArcPainter2.dart
Created May 29, 2019
ArcPainter with overriden paint method.
View ArcPainter2.dart
class ArcPainter extends CustomPainter {
ArcPainter({
this.strokeWidth,
this.backgroundColor,
this.valueColor,
this.headValue,
this.tailValue,
this.stepValue,
this.rotationValue
})
@JorgeCastilloPrz
JorgeCastilloPrz / ArcPainter1.dart
Last active May 29, 2019
CustomPainter declaration
View ArcPainter1.dart
class ArcPainter extends CustomPainter {
ArcPainter({
this.strokeWidth,
this.backgroundColor,
this.valueColor,
this.headValue,
this.tailValue,
this.stepValue,
this.rotationValue
})
View GroupRepository.kt
package com.data.instances
import com.data.Repository
import com.domain.Group
import com.domain.User
extension class GroupRepository(with val userRepository: Repository<User>) : Repository<Group> {
override fun loadAll(): List<Group> {
return listOf(Group(userRepository.loadAll()))
}
View blogpostdraft.md

Exploring Material Components

Initial thoughts

Not long ago a new version of the Material Design Guidelines was published by Google, and that came along with enhanced support for integration of the principles to the community. This included other interesting resources like some fancy sample projects mimicking real world apps called Material Studies, a brand new Sketch plugin for generating Material themes and styles, and a new Material Components library that intents to replace the old Design Support Library, among other initiatives.

As you probably have heard of, in terms of Android, Android Support Library 28 will be the last version deployed ever, and we'll move directly into the AndroidX APIs (JetPack) once for

View PolymorphicDeferredTest2.kt
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val deferredModuleAlt = Module(DeferredK.async())
deferredModuleAlt.run {
View PolymorphicProgram.kt
package me.jorgecastillo.polymorphicapps.polymorphic
import arrow.Kind
import arrow.core.Option
import arrow.core.left
import arrow.core.right
import arrow.effects.IO
import arrow.effects.async
import arrow.effects.fix
import arrow.effects.typeclasses.Async
View PolymorphicIOTest.kt
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val ioModule = Module(IO.async())
ioModule.run {
View PolymorphicDeferredTest.kt
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val deferredModule = Module(DeferredK.async())
deferredModule.run {
View PolymorphicObservableFlowableTest.kt
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val observableModule = Module(ObservableK.async())
observableModule.run {
View MaybeRuntimeTest.kt
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val maybeModule = Module(MaybeK.async())
maybeModule.run {
repository.allTasksByUser(user1).fix().maybe.subscribe({ println(it) }, { println(it) })
repository.allTasksByUser(user2).fix().maybe.subscribe({ println(it) }, { println(it) })
You can’t perform that action at this time.