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 kotlin.reflect.full.declaredMemberProperties | |
import kotlin.reflect.full.primaryConstructor | |
/** | |
* Merge two data classes | |
* | |
* The resulting data class will contain: | |
* - all fields of `other` which are non null | |
* - the fields of `this` for the fields which are null in `other` | |
* |
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
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
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.google.zxing.BarcodeFormat; | |
import com.google.zxing.EncodeHintType; | |
import com.google.zxing.MultiFormatWriter; | |
import com.google.zxing.WriterException; | |
import com.google.zxing.common.BitMatrix; | |
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; | |
import java.util.Hashtable; |
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
/* | |
* Code by @vmironov on Kotlinlang slack. | |
* | |
* This code uses dynamic proxies in Java to make it easier to access inaccessible classes via an accessible representation. | |
*/ | |
inline fun <reified T : Any> createMirror(value: Any) = createMirror(value, T::class.java) | |
fun <T> createMirror(value: Any, clazz: Class<T>): T { | |
val loader = clazz.classLoader |
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 com.xwray.vectorbinding; | |
import android.databinding.BindingAdapter; | |
import android.databinding.DataBindingUtil; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; | |
import android.support.graphics.drawable.VectorDrawableCompat; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.TextView; |
Original solution sacrifices new api lint check.
Here my solution:
int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
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 | |
""" | |
Pandoc filter to convert svg files to pdf as suggested at: | |
https://github.com/jgm/pandoc/issues/265#issuecomment-27317316 | |
""" | |
__author__ = "Jerome Robert" | |
import mimetypes | |
import subprocess |
NewerOlder