Skip to content

Instantly share code, notes, and snippets.

Daniel Gomez caipivara

  • La Haus
  • Medellin, Colombia
Block or report user

Report or block caipivara

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
caipivara / jacoco.gradle
Created May 16, 2019
Android / Gradle - Jacoco gradle setup to join instrumentation and unit test coverage
View jacoco.gradle
// Merge of
// and
// Requires Jacoco plugin in build classpath.
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.3"
caipivara /
Created May 3, 2019
Add empty space recursively on each file for current folder
for f in $(find . -name '*.kt')
echo "" >> "$f"
caipivara /
Created Dec 10, 2018
Bash - Replace all with find
find $1 -type f -exec sed -i "s/$2/$3/g" '{}' \;
caipivara / Observable+Extensions.swift
Created Jun 15, 2018
ios - how to add an extension to Observable and generics
View Observable+Extensions.swift
import Foundation
import RxSwift
import RxCocoa
extension ObservableType where E == String {
/// Limit the max size of the string that's been emitted
func limit(maxStringSize: Int) -> RxSwift.Observable<String> {
return scan("") { (previous, new) -> String in
return new.count <= maxStringSize ? new : previous
caipivara / TextViewExtensions.kt
Created Feb 26, 2018
Extension to set a text with HTML tags on TextView
View TextViewExtensions.kt
fun TextView.setHtmlText(text: String) {
val formattedText = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY)
} else {
setText(formattedText, TextView.BufferType.SPANNABLE)
movementMethod = LinkMovementMethod.getInstance()
caipivara / gist:874cd2f7a923173415817136d761d3e8
Created Feb 17, 2018
[Kotlin, rxjava and room] - how to always get a value from Maybe
View gist:874cd2f7a923173415817136d761d3e8
class Optional<out M>(val data: M?)
interface PatientDao {
@Query("SELECT * FROM $patientTableName LIMIT 1")
fun getFirst(): Maybe<User>
You can’t perform that action at this time.