var drawGravity: Int by InvalidateDelegate(Gravity.LEFT)
private inner class InvalidateDelegate<T>(t: T) : SetActionDelegate<T>(t, {
invalidate()
})
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
// 放到 app/build.gradle 文件内 | |
task showDeps { | |
doLast { | |
project.configurations.mrDebugRuntimeClasspath.each { File file -> | |
project.file('mrDebugDependencies.txt') << "${file.path} \n" | |
} | |
} | |
} |
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
function fish_prompt -d "Write out the prompt" | |
printf '%s %s @ %s in %s [%s] \n%s ' (set_color blue)(echo \#) (set_color cyan)$USER(set_color normal) (set_color green)$hostname(set_color normal) \ | |
(set_color yellow)(prompt_pwd)(set_color normal) \ | |
(echo -n (date +%H:%M:%S)) \ | |
(set_color red)(echo \$)(set_color normal) | |
end |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\InputMethod\Settings\CHS] | |
"EnableExtraDomainType"=dword:00000001 | |
"Enable Double Pinyin"=dword:00000001 | |
"DoublePinyinScheme"=dword:0000000a | |
"UserDefinedDoublePinyinScheme0"="小鹤双拼*2*^*iuvdjhcwfg^xmlnpbksqszxkrltvyovt" | |
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 re | |
import os | |
folder = os.getcwd() | |
count = 1 | |
# count increase by 1 in each iteration | |
# iterate all files from a directory | |
for file_name in os.listdir(folder): | |
# Construct old file name |
$ curl -s "https://get.sdkman.io" | bash
$ source "~/.sdkman/bin/sdkman-init.sh"
$ sdk install kotlin
$ cd /path/to/your/project
$ wget exported.main.kts
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
package com.example.playground | |
class Builder { | |
val setName: PropertiesSetter<String, Builder> = PropertiesSetter(this) | |
val setAge: PropertiesSetter<Int, Builder> = PropertiesSetter(this) | |
fun build(){ | |
setName.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
... | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setStyle(STYLE_NORMAL, R.style.FullScreenDialogTheme) | |
} | |
... |
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
# Usage: | |
# adb-clear com.android.chrome | |
adb shell "run-as $1 sh -c \"pm clear $1\"" |
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
while [[ $# -gt 0 ]] | |
do | |
key="$1" | |
case $key in | |
-c) | |
adb logcat -c | |
shift | |
;; | |
*) | |
esac |
NewerOlder