Skip to content

Instantly share code, notes, and snippets.

View victory316's full-sized avatar

SH Choi victory316

View GitHub Profile
@victory316
victory316 / TEST.txt
Created July 10, 2024 11:17
Example of creating subset including English, Korean, Japanese using fonttools
pyftsubset PretendardJP-Black.otf --output-file="./subset-fonts/retendardJP-Black-subset.otf" \
--layout-features='*' \
--unicodes=U+0020-007F,U+1100-11FF,U+AC00-D7AF,U+3130-318F,U+3040-309F,U+30A0-30FF,U+4E00-9FFF,U+FF00-FFEF,U+FF65-FF9F\
--glyph-names \
--symbol-cmap \
--legacy-cmap \
--notdef-glyph \
--notdef-outline \
--recommended-glyphs \
--name-legacy \
@victory316
victory316 / ColorFilter.kt
Created May 7, 2024 00:32
Jetpack compose colorFilter sample to make image dimmed in condition.
/**
* Reference: https://stackoverflow.com/a/78230014
*/
@Composable
fun ColorFilterSample(isActive: Boolean, iconResId: Int) {
val brightness = if (isActive) 0f else 0f
val contrast = if (isActive) 1f else 0.5f
val saturation = if (isActive) 1f else 0.7f
val filter = ColorFilter.colorMatrix(
# create remote branch when no branch exists when 'git push' performed
git config --global --add --bool push.autoSetupRemote true
@victory316
victory316 / build.gradle.kts
Last active December 21, 2023 05:40
Setup BuildConfig in different build flavour when using up to gradle 8.0
buildTypes {
release {
isDebuggable = false
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
configure<CrashlyticsExtension> {
@victory316
victory316 / SingularConditionEventChecker.kt
Created December 8, 2023 00:26
Conditional event checker
private const val KEY_LAST_ACCESS = "KEY_LAST_ACCESS"
private const val KEY_SENT_EVENT = "KEY_SENT_EVENT"
private const val KEY_RETENTION_DAY_COUNT = "KEY_RETENTION_DAY_COUNT"
class SingularConditionEventChecker @Inject constructor(
private val logger: AnalyticsLogger,
private val preferenceRepository: PreferencesRepository,
@Dispatcher(IO) private val ioDispatcher: CoroutineDispatcher
) {
@victory316
victory316 / BounceAnimationOnTouch.kt
Last active November 7, 2023 06:22
Jetpack compose animation on touch sample.
@Composable
fun BounceAnimationOnTouch(
touchedPoint: Offset,
contentSize: Dp,
content: @Composable BoxScope.(modifier: Modifier) -> Unit,
) {
val isVisible = remember { mutableStateOf(false) }
val animatable = remember { Animatable(0f) }
val duration = 500
@victory316
victory316 / Fastfile
Last active December 11, 2023 06:09
APK build anb publish to firebase with fastlane
desc "Submit a new Release Build to Firebase App Distribution"
lane :publishProdRelease do
gradle(
task: 'assemble',
flavor: "prod",
build_type: 'Release',
print_command: true,
properties: {
"android.injected.signing.store.file" => ENV["KEYSTORE_FILE"],
"android.injected.signing.store.password" => ENV["KEYSTORE_PASSWORD"],
@victory316
victory316 / decodeKeystore.yml
Last active October 16, 2023 13:53
Keystore decode to use in fastlane
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "android_keystore.keystore"
encodedString: ${{ secrets.RELEASE_KEY_APK }}
- run: fastlane publishProdRelease
env:
KEYSTORE_FILE : ${{ steps.android_keystore.outputs.filePath }}
@victory316
victory316 / testDistribution.yml
Last active October 16, 2023 13:47
Firebase release with fastlane
name: Test distribution to Firebase
on: workflow_dispatch
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Setup JDK 17
@victory316
victory316 / Fastfile
Last active October 16, 2023 13:02
Firebase App distribution with fastlane
desc "Submit a new Release Build to Firebase App Distribution"
lane :publishDevDebug do
devDebugBuild
firebase_app_distribution(
service_credentials_file: "firebase_credentials.json",
app: ENV["APP_ID"],
groups: "QA",
release_notes: "Test version of devDebug build."
)