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
isAC(){ | |
pmset -g batt | grep AC > /dev/null | |
} | |
TXT=$* | |
if [ "$TXT" = "" ] | |
then | |
TXT="อย่าปิดปลั๊ก" | |
fi |
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
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. | |
To use the support version of these attributes, remove the android namespace. | |
For instance, "android:colorControlNormal" becomes "colorControlNormal". | |
These attributes will be propagated to their corresponding attributes within the android namespace | |
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix. | |
All Clickable Views: | |
----------- |
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.content.Context; | |
import android.os.Debug; | |
import java.io.File; | |
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler { | |
private static final String FILENAME = "out-of-memory.hprof"; | |
public static void install(Context context) { | |
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler(); |
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 pl.kpob.utils.extensions | |
import android.app.Activity | |
import android.content.Context | |
import android.graphics.Color | |
import android.support.v4.content.ContextCompat | |
import android.view.WindowManager | |
import flow.Flow | |
import org.jetbrains.anko.AlertDialogBuilder | |
import pl.sisms.gminformix.utils.extensions.supportsLollipop |
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
// Adapted from http://stancalau.ro/java_package-info_generator_gradle/ | |
def generatedPackageInfoDir = "$buildDir/generated/package-info" | |
// Handle Android projects | |
if (project.plugins.hasPlugin("android")) { | |
android.sourceSets.main.java.srcDirs generatedPackageInfoDir | |
} | |
// Handle Java projects | |
if (project.plugins.hasPlugin("java")) { |
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 PostRepositoryImplTest { | |
private lateinit var repository: PostRepositoryImpl | |
private val mockCacheDataSource: PostCacheDataSource = mock() | |
private val mockRemoteDataSource: PostRemoteDataSource = mock() | |
private val postId = post.id | |
private val cacheItem = post.copy(title = "cache") |
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
<meta charset="UTF-8"> | |
<meta property="og:type" content="website" /> | |
<meta property="og:title" content="{% if amount %}Pay {{amount}}{% else %}Pay me{% endif %}" /> | |
<meta property="og:image" content="{{qrUrl}}"> | |
<meta property="og:url" content="{{url}}"> | |
<meta property="og:description" content=""> | |
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0"> | |
<title>{% if amount %}Pay {{amount}}{% else %}Pay me{% endif %}</title> | |
<style> | |
body{ |