Skip to content

Instantly share code, notes, and snippets.

View dzungvu's full-sized avatar

Vũ Thế Dũng dzungvu

  • Hochiminh City
View GitHub Profile
@dzungvu
dzungvu / create_ssh_key_guide.txt
Created December 2, 2023 15:42
create ssh key with custom location and name
#create ssh key with specified location and name
ssh-keygen -t ed25519 -f ~/.ssh/key_name -C "name@example.com"
eval "$(ssh-agent -s)"
open ~/.ssh/config
#in case config file does not exist
touch ~/.ssh/config
@dzungvu
dzungvu / print_keystore_info.gradle
Last active June 22, 2023 01:39
Print current build info: Key store, key alias, key pass. In case you checked remember password check-box in Generate Signed Bundle/Apk
afterEvaluate {
if (project.hasProperty("android.injected.signing.store.file")) {
println "key store path: ${project.property("android.injected.signing.store.file")}"
}
if (project.hasProperty("android.injected.signing.store.password")) {
println "key store password: ${project.property("android.injected.signing.store.password")}"
}
if (project.hasProperty("android.injected.signing.key.alias")) {
println "key alias: ${project.property("android.injected.signing.key.alias")}"
}
//delegate
class DistanceCalculator() {
fun calculate(vihecle: Vihecle, time: Float): Float {
return vihecle.speed * time
}
}
abstract class Vihecle(open val speed: Float, val model: String) {
//use the delegate instead of override travel function in each subclass
val distanceCalculator = DistanceCalculator()
private fun onShare() {
val sendIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND
type = "text/plain"
putExtra(Intent.EXTRA_TEXT, "Share default content")
}
val textEmail = "Share content use for email"
val textSMS = "Share content use for sms"
val textOther = "Share content for other app"
@dzungvu
dzungvu / README.md
Created February 10, 2022 10:30 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

#!/bin/bash
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -storepass abcdxyzt1234 -keystore my-key.keystore app-release.aab alias_name
cmd /c "jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -storepass abcdxyzt1234 -keystore my-key.keystore app-release.aab alias_name"
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
@dzungvu
dzungvu / adb_send_key.txt
Created September 20, 2021 03:39
adb send key event
ex: adb shell input keyevent 22
usage: input [text|keyevent]
input text <string>
input keyevent <event_code>
0 --> "KEYCODE_UNKNOWN"
1 --> "KEYCODE_MENU"
2 --> "KEYCODE_SOFT_RIGHT"
3 --> "KEYCODE_HOME"
package com.dzungvu.viewtopdf
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.os.Bundle
import android.os.Environment
import android.view.View
import android.widget.Button