Skip to content

Instantly share code, notes, and snippets.

View neronguyen's full-sized avatar

neronguyen

View GitHub Profile
@kriegalex
kriegalex / install-battlenet-on-cachyos-linux-steam-proton.md
Last active May 14, 2026 08:11
Install Battle.net on CachyOS Linux Using Steam & Proton

Install Battle.net on CachyOS Linux Using Steam & Proton

Tested on: CachyOS (Arch-based) · KDE Plasma 6.5 / 6.6 · Wayland · Steam (native pacman package)

Last updated: March 2026

Games confirmed working: World of Warcraft, Diablo IV, Diablo II: Resurrected, StarCraft Remastered, Hearthstone, Overwatch 2, Call of Duty

Why This Method?

1. hiltvm (applicable in top-level)
@dagger.hilt.android.lifecycle.HiltViewModel
class $NAME$ @javax.inject.Inject constructor(
$PARAM$
) : androidx.lifecycle.ViewModel() {
$END$
}
2. vmstatefunc (applicable in class)
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$)
@zach-klippenstein
zach-klippenstein / SegmentedControl.kt
Last active December 26, 2024 23:13
iOS-style segmented control in Compose
import android.annotation.SuppressLint
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.awaitFirstDown
import androidx.compose.foundation.gestures.forEachGesture
import androidx.compose.foundation.gestures.horizontalDrag
import androidx.compose.foundation.layout.Arrangement.spacedBy
import androidx.compose.foundation.layout.Box
@LouisCAD
LouisCAD / FusedLocationFlow.kt
Last active May 23, 2024 12:11
Create a Flow of location updates on Android (using kotlinx.coroutines), backed by Fused Location Provider from Google Play Services.
/*
* Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/
import android.location.Location
import com.google.android.gms.location.LocationCallback
import com.google.android.gms.location.LocationRequest
import com.google.android.gms.location.LocationResult
import com.google.android.gms.location.LocationServices
import kotlinx.coroutines.CancellationException
@vbsteven
vbsteven / Validators.kt
Created April 8, 2019 16:27
Custom Spring annotation and validator in Kotlin
package io.license.core.validation
import javax.validation.Constraint
import javax.validation.ConstraintValidator
import javax.validation.ConstraintValidatorContext
import javax.validation.Payload
import kotlin.reflect.KClass
@Target(AnnotationTarget.FIELD)
@nicolasdao
nicolasdao / open_source_licenses.md
Last active May 10, 2026 10:51
What you need to know to choose an open source license.