Skip to content

Instantly share code, notes, and snippets.

View Ashok-Varma's full-sized avatar
🎯
Focusing

Ashok Varma Ashok-Varma

🎯
Focusing
View GitHub Profile
@JakeWharton
JakeWharton / Truss.java
Last active August 12, 2024 07:31
Extremely simple wrapper around SpannableStringBuilder to make the API more logical and less awful. Apache 2 licensed.
import android.text.SpannableStringBuilder;
import java.util.ArrayDeque;
import java.util.Deque;
import static android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE;
/** A {@link SpannableStringBuilder} wrapper whose API doesn't make me want to stab my eyes out. */
public class Truss {
private final SpannableStringBuilder builder;
private final Deque<Span> stack;
@kosiara
kosiara / proguard-rules.pro
Created November 3, 2015 15:39
RxJava RxAndroid Proguard rules
#build.gradle
#
# compile 'io.reactivex:rxandroid:1.0.1'
# compile 'io.reactivex:rxjava:1.0.14'
# compile 'io.reactivex:rxjava-math:1.0.0'
# compile 'com.jakewharton.rxbinding:rxbinding:0.2.0'
# rxjava
-keep class rx.schedulers.Schedulers {
public static <methods>;
@ch4vi
ch4vi / KTruss.kt
Last active April 28, 2020 15:48
An adaptation of Truss from JakeWharton wrote in kotlin
import android.text.SpannableStringBuilder
import android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE
import java.util.*
/** A [SpannableStringBuilder] wrapper whose API doesn't make me want to stab my eyes out. */
class KTruss {
private val builder: SpannableStringBuilder = SpannableStringBuilder()
private val stack: Deque<Span> = ArrayDeque<Span>()
fun append(string: String): KTruss {