Skip to content

Instantly share code, notes, and snippets.

View arstagaev's full-sized avatar
🌌
Mad respect for the makers of things

Arsen Tagaev arstagaev

🌌
Mad respect for the makers of things
View GitHub Profile
@arstagaev
arstagaev / gist:0d8e8e220f41db48cbe8d5a1cfbb667b
Created October 9, 2023 21:07
Install Apps by adb Wi-Fi in Wear OS //
nano ~/.zshrc
enter:
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
source ~/.zshrc
adb devices
adb pair 192.168.##.##:#####
@mcpiroman
mcpiroman / build.gradle.kts
Last active June 6, 2024 05:03
Compose for Desktop with Proguard setup
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
buildscript {
dependencies {
classpath("com.guardsquare:proguard-gradle:7.2.1")
}
}
repositories {
@EugeneTheDev
EugeneTheDev / DotsLoaders.kt
Created March 18, 2021 23:15
Dots loading animations with Jetpack Compose
import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@Oleur
Oleur / ComposeCanvasText.kt
Last active May 13, 2024 17:27
Draw text on Jetpack Compose Canvas
val textPaint = Paint().asFrameworkPaint().apply {
isAntiAlias = true
textSize = 24.sp.toPx()
color = android.graphics.Color.BLUE
typeface = Typeface.create(Typeface.MONOSPACE, Typeface.BOLD)
}
Canvas(
modifier = modifier.fillMaxSize(),
onDraw = {
drawIntoCanvas {
@Dominaezzz
Dominaezzz / AnimatedGif.kt
Last active March 22, 2024 02:45
Rendering GIF animation with compose
import androidx.compose.animation.core.*
import androidx.compose.desktop.Window
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
@Trogious
Trogious / git_tag_or_version_gradle.md
Last active March 9, 2024 20:44
How to get latest git tag or commit ID (gradle)

How to get latest git tag or commit ID (gradle)

The following will give you the latest git tag name (if the HEAD is tagged) or latest commit ID otherwise. The getAppVersion function returns the end value.

Why is this useful?

I use it to name packages of my builds and other versioning purposes in my Android projects.

The code:

def getAppVersion = { ->
 def stdout = new ByteArrayOutputStream()
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@wesleybliss
wesleybliss / simple_observer.kt
Created March 4, 2020 16:42
Simple Kotlin Observer Pattern
interface Observer<T> {
fun onChange(newValue: T?)
}
class Observable<T>(initialValue: T? = null) {
// List ov observers watching this value for changes
private val observers = mutableListOf<Observer<T>>()
// The real value of this observer
@sam016
sam016 / AllGattCharacteristics.java
Last active July 5, 2024 15:52
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");