This file contains hidden or 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
<b>英文名:</b> <?= enTitle ?> | |
<br><b>中文名:</b> <?= zhTitle ?> |
This file contains hidden or 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 DemoActivity : AppCompatActivity() { | |
private lateinit var viewModel: MyViewModel | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
viewModel = viewModel(MyViewModel.Factory(application)) | |
setContentView(R.layout.activity_demo) | |
} | |
} |
This file contains hidden or 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.facebook.react.bridge.Arguments | |
import com.facebook.react.bridge.WritableArray | |
import com.facebook.react.bridge.WritableMap | |
fun writableMapOf(vararg values: Pair<String, *>): WritableMap { | |
val map = Arguments.createMap() | |
for ((key, value) in values) { | |
when (value) { | |
null -> map.putNull(key) | |
is Boolean -> map.putBoolean(key, value) |
This file contains hidden or 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.graphics.Canvas | |
import android.graphics.Paint | |
import android.graphics.RectF | |
import android.support.annotation.ColorRes | |
import android.support.v4.content.res.ResourcesCompat | |
import android.support.v4.view.ViewCompat | |
import android.support.v7.widget.RecyclerView | |
import org.jetbrains.anko.dip |
This file contains hidden or 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": "001", | |
"initial": "FEP", | |
"titleZh": "屯門碼頭", | |
"titleEn": "Tuen Mun Ferry Pier", | |
"latitude": 22.37284525, | |
"longitude": 113.9661371, | |
"fareZone": "1", | |
"platforms": [ |
This file contains hidden or 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
/** | |
* Version number in [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html) specification (SemVer). | |
* | |
* @property major major version, increment it when you make incompatible API changes. | |
* @property minor minor version, increment it when you add functionality in a backwards-compatible manner. | |
* @property patch patch version, increment it when you make backwards-compatible bug fixes. | |
* @property preRelease pre-release version. | |
* @property buildMetadata build metadata. | |
*/ | |
data class SemVer( |
This file contains hidden or 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
<templateSet group="TimberJava"> | |
<template name="timd" value="timber.log.Timber.d("$METHOD_NAME$: $content$");" description="Timber.d(String)" toReformat="true" toShortenFQNames="true"> | |
<variable name="METHOD_NAME" expression="methodName()" defaultValue="" alwaysStopAt="false" /> | |
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="time" value="timber.log.Timber.e($exception$, "$METHOD_NAME$: $content$");" description="Timber.e(Exception, String)" toReformat="true" toShortenFQNames="true"> | |
<variable name="exception" expression="" defaultValue="e" alwaysStopAt="true" /> |
This file contains hidden or 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
#!/bin/bash | |
while true | |
do | |
adb shell dumpsys deviceidle step | |
sleep 1 | |
done |
This file contains hidden or 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 java.util.regex.Pattern | |
apply plugin: 'com.android.application' | |
/** | |
* Extract Git commit hash of HEAD with number of changed files | |
*/ | |
def getGitHashVersionName = { | |
try { | |
def hashOutput = new ByteArrayOutputStream() |