- Tempos de build e testes
- Tamanho do repositório (tempo de checkout)
- Nescessidade de tooling dedicado
- Tendencia a aumentar o acoplamento entre as dependências
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//An memoize fn would be good to use here. | |
const getService = (serviceName) => angular.element(document.body).injector().get(serviceName); | |
export default new Proxy({}, { | |
get (target, prop) { | |
return getService(prop); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle | |
// Dunno if there's a better way to extend both bundle and intents, but | |
// you probably can extend intents in the same way | |
fun Bundle.putEnum(key:String, enum: Enum<*>){ | |
putString(key, enum.name) | |
} | |
inline fun <reified T: Enum<T>> Bundle.getEnum(key:String): T { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.ref.WeakReference | |
// It doesn't matter for the receiver which one is the received argument | |
typealias LateBoxList<R> = List<LateMapBox<*, R>> | |
fun <T, R> Iterable<T>.mapAsLateBox(mapper: (T) -> R): List<LateMapBox<T, R>> { | |
return this.map { LateMapBox(it, mapper) } | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Forks a nullable into a non nullable, | |
* | |
* This differs from the if else expression | |
* which is thread unsafe and doesn't guarantee | |
* the non nullability even if the value was validated as non null | |
* by the if expression (due to concurrency) | |
* NOTE: need to check this :D, probably i need to use contracts like the std to assure what | |
* i said above | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This function doesn't work. I get a tiny error log saying that i cannot | |
* update the email of a anonymous user and that i should call `registerIdentifiedUser` | |
* | |
* In the `RealIntercom` class, on the `registerIdentifiedUser` | |
* there's a if condition that fails in this case | |
* `if (userIdentity.canRegisterIdentifiedUser(userRegistration))` | |
* | |
* It fails cuz the `Registration` class expects the `updateState` to be called | |
* at least once, `withEmail` and `withUserId` are the ones that do that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<- $ # module settings where | |
{ map, join, concat, filter, empty, fold, all, sort-by, any } = require 'prelude-ls' | |
response = JSON.parse """ | |
{ | |
"requestRepository":true, | |
"enterprises":[ | |
{ | |
"code":"T1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class QuerySpec<Manager, Entity, TRepository : Repository<Manager, Entity>, Return> { | |
abstract fun fetchResult(arg: Manager): Return | |
} | |
abstract class Repository<Manager, Entity> { | |
abstract val manager: Manager | |
fun <TQuerySpec : QuerySpec<Manager, Entity, Repository<Manager, Entity>, Return>, Return> executeQuery(querySpec: TQuerySpec): Return { | |
return querySpec.fetchResult(manager) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* All the massive/repetitive/boring activity code above */ | |
override fun onPrepareOptionsMenu(menu: Menu) { | |
super.onPrepareOptionsMenu(menu) | |
val filterMenu = menu.findItem(R.id.actionFilter) | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package why.android.dont.have.those | |
import android.graphics.Bitmap | |
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.annotation.ColorRes | |
import androidx.core.content.ContextCompat |
OlderNewer