Шпаргалка с командами Docker
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
10 01;setDefaultSession | |
10 02;setProgrammingSession | |
10 03;setExtendedDiagnosticSession | |
11 01;hardReset | |
14 FF FF FF,31 01 0F 06,31 01 40 00 00,31 01 40 00 05,31 01 40 00 01;Clear all DTCs (clear DTC,clear Infospeicher,ZFS ***8211; DM_Lock,clear ZFS ***8211; DM_Clear,ZFS ***8211; DM_Unlock) | |
14 FF FF FF;Clear DTC | |
19 02 0C;ReadDTC(0C) | |
19 0A;ReadSupportedDTC | |
22 10 0A;readEnergyMode | |
22 10 0E;readExtendedMode |
Приветствую, любители реверс-инжинирить Android. Перед вами шпаргалка по Smali - аналогу ассемблера для Android-приложений.
Изначальный текст на русском взят отсюда. Там текст появился из машинного перевода официальной документации.
В итоге, оформил сухой текст + поправил небольшие опечатки и корявости перевода. По поводу замечаний и предложений можете писать либо мне в ЛС, либо оформлять PR на Gist.
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 sys | |
import glob | |
import ruamel.yaml | |
yaml = ruamel.yaml.YAML() | |
def main(): | |
# python3 pubspec_base_sync.py ../pubspec_base_android.yaml ../pubspec_base_android_huawei.yaml |
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
main() { | |
final value = async(() { | |
final num1 = await(Future.value(5)); | |
final num2 = await(Future.value(2)); | |
return num1 * num2; | |
}); | |
value.then(print).catchError(print); | |
async(() { | |
[1,2,3,4,5].forEach((i) { |
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
main() { | |
// Either<dynamic, int> result | |
final result = Either.Do(() { | |
final num1 = perform(Right(5)); | |
final num2 = perform(Right(2)); | |
return num1 * num2; | |
}); | |
print(result.value); // 10 | |
// Option<int> result2 | |
final result2 = Option.Do(() { |
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
void main() { | |
Greeting message = Hi(); | |
final result = match(message, { | |
on((Hi hi) => "hello, ${hi.name}"), | |
on((Bye bye) => "bye, see you at ${bye.seeYouAgain}"), | |
otherwise(() => throw Error()), | |
}); | |
print(result); |
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 androidx.compose.foundation.BorderStroke | |
/* | |
* Copyright 2020 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
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
interface Mapper<K, T> { | |
fun map(entity: K): T | |
fun map(list: List<K>): List<T> = list.map(this::map) | |
} | |
interface Mapped | |
//For objects implemented Mapped | |
fun <T:Mapped, K> List<T>.map(mapper: Mapper<T, K>): List<K> = this.map(mapper::map) | |
fun <T:Mapped, K> T.map(mapper: Mapper<T, K>) = mapper.map(this) | |
//For Any objects |
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 androidx.annotation.StringRes | |
import androidx.test.espresso.Espresso.onView | |
import androidx.test.espresso.ViewInteraction | |
import androidx.test.espresso.matcher.ViewMatchers | |
import org.hamcrest.CoreMatchers | |
import org.hamcrest.CoreMatchers.allOf | |
fun onSnackbar(@StringRes withText: Int): ViewInteraction { | |
return onView( | |
CoreMatchers.allOf( |
NewerOlder