Skip to content

Instantly share code, notes, and snippets.

View itstanany's full-sized avatar
🎯
Focusing

Tanany itstanany

🎯
Focusing
View GitHub Profile
@raamcosta
raamcosta / UiText.kt
Created October 6, 2021 23:00
UiText.kt
sealed class UiText {
class DynamicText(val text: String) : UiText()
class ResourceText(@StringRes val stringRes: Int) : UiText()
}
fun UiText.getString(context: Context) = when (this) {
is UiText.DynamicText -> text
is UiText.ResourceText -> context.getString(stringRes)
@kumaran-IV0IV
kumaran-IV0IV / Open with Android Studio.cmd
Last active March 7, 2024 14:53
Add `Open with Android Studio` to Windows right click context menu
@echo off
:: change the path below to match your installed version
SET AndroidStudioPath=C:\Program Files\Android\Android Studio\bin\studio64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio" /t REG_SZ /v "" /d "Open with AndroidStudio" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio" /t REG_EXPAND_SZ /v "Icon" /d "%AndroidStudioPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio\command" /t REG_SZ /v "" /d "%AndroidStudioPath% \"%%1\"" /f