Skip to content

Instantly share code, notes, and snippets.

View racka98's full-sized avatar
🏠
Working from home

rackadev racka98

🏠
Working from home
View GitHub Profile
@iraSenthil
iraSenthil / gist:3222887
Created August 1, 2012 02:20
Restart ADB in single command
cmd /c “adb kill-server&&adb start-server”
@lopspower
lopspower / README.md
Last active November 18, 2024 19:11
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active November 19, 2024 11:06
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@phhusson
phhusson / AppsOverADB.kt
Created February 2, 2021 21:33
Remote control apps running on a smartphone
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@c5inco
c5inco / MaterialMotionTransitions.kt
Last active December 7, 2023 08:12
Reusable transitions that map to Material 2 motion system - https://material.io/develop/android/theming/motion
// Requires Compose 1.1.0-alpha02+
// Best used with navigation animation transitions in Accompanist 0.17.0+
import androidx.compose.animation.*
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group.contains('org.jetbrains.compose')) {
def groupName = details.requested.group.replace("org.jetbrains.compose", "androidx.compose")
details.useTarget(
[group: groupName, name: details.requested.name, version: details.requested.version]
)
}
}
}
@mihai-dinculescu
mihai-dinculescu / 01-build.rs
Last active September 4, 2024 17:48
ESP32-MQTT-Rust
// build.rs
use embuild::build::LinkArgs;
fn main() -> anyhow::Result<()> {
// Necessary because of this issue: https://github.com/rust-lang/cargo/issues/9641
LinkArgs::output_propagated("ESP_IDF")?;
Ok(())
}
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@surajsau
surajsau / ParallaxScreen.kt
Last active June 28, 2024 21:14
Parallax effect with Jetpack Compose
@Composable
fun ParallaxScreen(modifier: Modifier = Modifier) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
var data by remember { mutableStateOf<SensorData?>(null) }
DisposableEffect(Unit) {
val dataManager = SensorDataManager(context)
dataManager.init()
@OptIn(ExperimentalAnimationApi::class)
@Composable
fun CountDown(
count: Int?,
modifier: Modifier = Modifier,
) {
val transitionDuration = 500
val enterTransition = scaleIn(initialScale = 1.5f, animationSpec = tween(transitionDuration))
val exitTransition = scaleOut(targetScale = 4f, animationSpec = tween(transitionDuration)) + fadeOut(animationSpec = tween(transitionDuration))
AnimatedVisibility(