Skip to content

Instantly share code, notes, and snippets.

View ch8n's full-sized avatar
💻
Always on to writing my next article.

Chetan Gupta ch8n

💻
Always on to writing my next article.
View GitHub Profile
@Composable
fun CardGradient(modifier: Modifier = Modifier) {
Card(
modifier = Modifier.padding(16.dp).fillMaxWidth().aspectRatio(600 / 400f)
.clip(RoundedCornerShape(16.dp))
) {
Gradient()
}
}
@NitinPraksash9911
NitinPraksash9911 / Automate Baseline profiler generator script
Last active October 19, 2022 16:23
This can be used whenever releasing app we have to generate the baseline profile for app-startup time improvement so this script remove overhead of manual doing all the stesp
#!/bin/sh
# this will exit the script if any command fails
set -e
set -o pipefail
## FOLLOW THIS STEPS FIRS TO SET EVN VARIABLE FOR THE FOLLOWING COMMANDS
# Set android home path
export ANDROID_HOME=~/Library/Android/sdk
@thelumiereguy
thelumiereguy / CantorCirclePatternComposable.kt
Last active March 5, 2022 16:50
A Jetpack Compose based example to draw a modified Cantor Circle using recursion
const val MAX_ITERATIONS = 7f
@OptIn(ExperimentalGraphicsApi::class)
@Composable
fun CantorCirclePatternComposable(modifier: Modifier) {
BoxWithConstraints(modifier = Modifier) {
val frame by rememberInfiniteTransition().animateFloat(
@mxalbert1996
mxalbert1996 / Scrollbar.kt
Last active April 15, 2025 09:09
Modifiers to draw scrollbars in Jetpack Compose
/*
* MIT License
*
* Copyright (c) 2022 Albert Chang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@zach-klippenstein
zach-klippenstein / Blockify.kt
Last active March 22, 2024 21:47
A Compose modifier to turn your apps into blocks (no, this has nothing to do with NFTs)
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.integration.demos.BlockFilter.Companion.Lighting
private fun getClient(): WebViewClient {
return object : WebViewClient() {
override fun shouldInterceptRequest(
view: WebView?,
request: WebResourceRequest?
): WebResourceResponse? {
return super.shouldInterceptRequest(view, request)
}
override fun shouldInterceptRequest(view: WebView?, url: String?): WebResourceResponse? {
import androidx.compose.animation.*
import androidx.compose.animation.core.tween
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.onCommit
import androidx.compose.ui.Modifier
@OptIn(ExperimentalAnimationApi::class, ExperimentalMaterialApi::class)
@Composable
fun <T> AnimatedSwipeDismiss(
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active May 9, 2025 16:36
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@Pulimet
Pulimet / AdbCommands
Last active May 9, 2025 15:17
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@vestrel00
vestrel00 / Dagger2SimpleExample.java
Last active October 7, 2021 19:59
A: Dagger.android 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
// This is a super simplified example of how to use the new dagger.android framework
// introduced in Dagger 2.10. For a more complete, in-depth guide to dagger.android
// read https://proandroiddev.com/how-to-android-dagger-2-10-2-11-butterknife-mvp-part-1-eb0f6b970fd
// For a complete codebase using dagger.android 2.11-2.17, butterknife 8.7-8.8, and MVP,
// see https://github.com/vestrel00/android-dagger-butterknife-mvp
// This example works with Dagger 2.11-2.17. Starting with Dagger 2.11,
// @ContributesAndroidInjector was introduced removing the need to define @Subcomponent classes.