Skip to content

Instantly share code, notes, and snippets.


Daniel Gomez danielgomezrico

View GitHub Profile
danielgomezrico /
Created Dec 10, 2018
Bash - Replace all with find
find $1 -type f -exec sed -i "s/$2/$3/g" '{}' \;
danielgomezrico / 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
danielgomezrico / 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()
danielgomezrico / 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>
danielgomezrico /
Last active Feb 5, 2018 — forked from tomazzlender/
rbenv install and system wide install on Ubuntu to /opt/rbenv
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git:// /opt/rbenv
# Add rbenv to the path:
danielgomezrico / .gitlab-ci.yml
Last active Jun 16, 2020
Android / Gitlab ci - sample setup files to setup your own local gitlab runner with real physical android devices. Check
View .gitlab-ci.yml
- build
- test
- deploy