This file contains 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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import os | |
import sys | |
import xml.etree.ElementTree as ET | |
import re | |
idAttrib = '{http://schemas.android.com/apk/res/android}id' |
This file contains 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.media.AudioFormat; | |
import android.media.AudioRecord; | |
import android.media.MediaRecorder.AudioSource; | |
import android.os.Process; | |
public class AudioMeter extends Thread { | |
///////////////////////////////////////////////////////////////// | |
// PUBLIC CONSTANTS | |
// Convenience constants |
This file contains 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
if [ "$#" == "0" ]; then | |
echo "usage: adbs <device> <command>" | |
n=0 | |
while read -r line | |
do | |
if [ "$n" -gt "0" ] && [ -n "$line" ]; then | |
echo "$n: " "$line" | |
else | |
echo "$line" |
This file contains 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 hello | |
import hello.Language.* | |
enum class Language(val greeting: String) { | |
EN("Hello"), ES("Hola"), FR("Bonjour") | |
} | |
open class Person(var name: String, var lang: Language = EN) { | |
fun greet() = println("${lang.greeting}, $name!") |
This file contains 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 com.sun.jdi.InvalidTypeException | |
import java.util.LinkedHashSet | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
public object Properties { | |
fun observable<T>(initialValue: T): ReadWriteProperty<Any?, T> { | |
return ObservableProperty(initialValue) | |
} | |
} |
This file contains 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
remote.getIt(foo) // Observable<Bar> | |
//.doOnNext { local.saveIt(bar).toBlocking().single() } // "Interrupted while waiting for subscription to complete" on errors. | |
.flatMap { bar -> local.saveIt(bar).map { bar } } // Hacky, but makes saving part of stream and won't throw exceptions due to blocking observable. |
This file contains 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
@Plumbed(MyViewIntent.class) | |
class MyView extends FrameLayout { | |
@Inject | |
public MyViewIntent viewIntent; | |
@Out("red") | |
public Observable<Integer> red; | |
@Out("green") | |
public Observable<Integer> green; | |
@Out("blue") |
This file contains 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
class DaggerService(private val rootComponent: Any) : ServicesFactory() { | |
override fun bindServices(services: Binder) { | |
val key = services.getKey<Any>() | |
if (key !is WithComponent) { | |
return | |
} | |
val parent = services.getService<Any>(NAME) ?: rootComponent | |
val component = key.createComponent(parent) |
This file contains 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 rx.Observable | |
import java.util.LinkedHashMap | |
class HashStreamMap<K> : LinkedHashMap<K, Observable<*>>, MutableStreamMap<K> { | |
constructor() : super() | |
constructor(initialCapacity: Int) : super(initialCapacity) | |
constructor(initialCapacity: Int, loadFactor: Float) : super(initialCapacity, loadFactor) |
This file contains 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 clean.news.adapter | |
import android.content.Context | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import clean.news.R | |
import clean.news.core.entity.Item.ListType | |
import clean.news.inject.ModuleContext | |
import clean.news.ui.item.list.ItemListKey.ItemListModule |
OlderNewer