Skip to content

Instantly share code, notes, and snippets.

Avatar

Héctor de Isidro hrules6872

View GitHub Profile
@hrules6872
hrules6872 / Demo.kt
Last active Jan 25, 2019 — forked from alexfu/Demo.kt
Making (Android) Spannable great again with Kotlin
View Demo.kt
val world = "World"
val spannedText = SpannableString("Hello $world!")
spannedText
.spanWith(world) {
what = BackgroundColorSpan(Color.RED)
flags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
}
.spanWith(world) {
what = StyleSpan(Typeface.BOLD)
flags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
@hrules6872
hrules6872 / ParameterizedKotlinTest.kt
Created Dec 13, 2018 — forked from rossharper/ParameterizedKotlinTest.kt
Parameterized JUnit4 test example in Kotlin
View ParameterizedKotlinTest.kt
@RunWith(Parameterized::class)
class KotlinTest(val paramOne: Int, val paramTwo: String) {
companion object {
@JvmStatic
@Parameterized.Parameters
fun data() : Collection<Array<Any>> {
return listOf(
arrayOf(1, "I"), // First test: (paramOne = 1, paramTwo = "I")
arrayOf(1999, "MCMXCIX") // Second test: (paramOne = 1999, paramTwo = "MCMXCIX")
@hrules6872
hrules6872 / gh2bb_migrate_cheapass.py
Created Jun 8, 2018
Migrate all your private github repos to bitbucket because you're CHEAP.
View gh2bb_migrate_cheapass.py
__author__ = 'schwa'
import os
import subprocess
import glob
from github import Github # pip install PyGithub
from bitbucket.bitbucket import Bitbucket # pip install --user bitbucket-api
GH_USERNAME = 'jwight@mac.com'
GH_PASSWORD = '1234'
@hrules6872
hrules6872 / android-26-sources.md
Created Sep 12, 2017 — forked from cketti/android-26-sources.md
Build your own android-26 sources
View android-26-sources.md

If you are annoyed that "Sources for Android 26" are not yet available via SDK manager, this might be for you:

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base