Skip to content

Instantly share code, notes, and snippets.

View tw-Frey's full-sized avatar

Frey tw-Frey

  • Taipei, Taiwan
View GitHub Profile
@tw-Frey
tw-Frey / proguard_outputs.md
Created December 1, 2020 05:09
Proguard/R8 and its outputs

通常 Android App 要上架
release 會作 Proguard/R8
可是在 Google Play console 看當機報告
看到的會是混淆結果
其實可以上傳 mappings
方便在 Google Play console 追蹤

既然提到 mappings
多少要了解 Proguard 有哪些產出

  • mapping.txt
https://androidversions.dev/
Android development now involves stitching together a large number of libraries and tools.
This site tracks those library version numbers and produces a suggested build.gradle(.kts)
@tw-Frey
tw-Frey / fe43adef48e6162e6166.md
Last active December 21, 2025 19:49
KDoc 書き方メモ(Kotlin のドキュメンテーションコメント)
@tw-Frey
tw-Frey / Search my gists.md
Created August 4, 2021 02:09 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@tw-Frey
tw-Frey / iso_8601_no_zone.md
Last active August 4, 2021 03:21
DateTime ISO 8601 without timezone component

For example:

2012-01-01T00:00:00       # Convert to local
2012-01-01T00:00:00Z      # Zulu/UTC...don't convert
2012-01-01T00:00:00+00:00 # Zulu/UTC...don't convert

來源

@tw-Frey
tw-Frey / proguard-logging-rules.pro
Last active September 9, 2021 21:54
利用 -assumenosideeffects 將 logging 失效優化 (by Proguard/R8)
# no logging in production
# https://medium.com/yazio-engineering/6566bc387b63
-assumenosideeffects class android.util.Log {
v(...);
d(...);
i(...);
w(...);
e(...);
wtf(...);
println(...);
@tw-Frey
tw-Frey / sh-agent-bash.md
Created September 29, 2021 10:23
解決,Ssh Add 出現 Could Not Open A Connection To Your Authentication Agent.

當執行 ssh-add 時

ssh-add ~/.ssh/<private_key_file>

如果出現錯誤訊息: Could not open a connection to your authentication agent.

執行進入 ssh bash ,就能正執行 ssh-add

ssh-agent bash
@tw-Frey
tw-Frey / addUnsafeNonAscii.md
Last active November 4, 2021 07:37
OkHttp Header add non-ASCII value 會 IllegalArgumentException

會報 IllegalArgumentException 係因為

    /**
     * Add a header with the specified name and value. Does validation of header names and values.
     */
    fun add(name: String, value: String) = apply {
      checkName(name)
      checkValue(value, name)
      addLenient(name, value)
    }
@tw-Frey
tw-Frey / shapeshifter_design.md
Created November 4, 2021 09:07
Create your own Animated Vector Drawable on Android App

https://shapeshifter.design/

image image

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
@tw-Frey
tw-Frey / isLazyInitialized.md
Last active August 6, 2023 18:21
Kotlin: Check if lazy val has been initialised

Since Kotlin 1.1, you can access a property delegate directly using .getDelegate().

You can write an extension property for a property reference that checks that it has a Lazy delegate that has already been initialized:

/**
 * Returns true if a lazy property reference has been initialized, or if the property is not lazy.
 */
val KProperty0<*>.isLazyInitialized: Boolean
 get() {