Skip to content

Instantly share code, notes, and snippets.

View kibotu's full-sized avatar
🎯
Focusing

Jan Rabe kibotu

🎯
Focusing
View GitHub Profile
@kibotu
kibotu / CircularReveal.kt
Last active December 22, 2023 13:21 — forked from darvld/CircularReveal.kt
A circular reveal effect modifier for Jetpack Compose.
View CircularReveal.kt
/**
* A modifier that clips the composable content using a circular reveal animation. The circle will
* expand or shrink whenever [isVisible] changes.
*
* For more control over the transition, consider using this method's variant which allows passing
* a [State] object to control the progress of the reveal animation.
*
* By default, the circle is centered in the content. However, custom positions can be specified using
@kibotu
kibotu / build-ios-project-set-marketing-version.sh
Created July 3, 2023 07:24
Build iOS Project on command line. Set MARKETING_VERSION and CURRENT_PROJECT_VERSION.
View build-ios-project-set-marketing-version.sh
#!/bin/bash
# https://stackoverflow.com/a/76070326/1006741
# Set the version and build numbers
VERSION_NUMBER="2.1.0"
BUILD_NUMBER="29"
APP_NAME="MyApp"
TEAM_ID="ABCDEFGH"
@kibotu
kibotu / .bash_profile
Created June 16, 2023 17:43 — forked from hakusaro/.bash_profile
My Raspberry Pi's .bash_profile. Differences from original are purely aesthetic - no need for weather, and I like things to be lined up nicely when I ssh into my RPi.
View .bash_profile
#!/bin/bash
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
# get the load averages
read one five fifteen rest < /proc/loadavg
@kibotu
kibotu / README.md
Created January 26, 2023 08:14
gradle supply chain attack checksum check
View README.md
View SectionItemDecoration.kt
import android.graphics.Canvas
import android.graphics.Rect
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
/**
* Created with Android Studio
* User: Sergey Petrov s.a.petrov.spb@gmail.com
@kibotu
kibotu / build-json-generator.gradle
Last active July 18, 2022 12:32
Generating build time variables into app/asset folder. Newly support for configuration caching.
View build-json-generator.gradle
/**
* Task to generate build.json and puts it into assets/meta folder within the app.
*/
preBuild.dependsOn tasks.register("generateBuildJson") {
// note: file can't be named 'build.json' otherwise it will not be bundled into the app.
outputs.file(project.rootProject.file('app/src/main/assets/meta.json'))
// need to remember configuration variables for later task execution
@kibotu
kibotu / LruBitmapCache.kt
Last active June 3, 2022 17:59
LruBitmapCache
View LruBitmapCache.kt
import android.graphics.Bitmap
import androidx.collection.LruCache
val runtimeMemoryChunkInBytes: Int
get() = (Runtime.getRuntime().maxMemory() / 8).toInt()
/**
* https://developer.android.com/topic/performance/graphics/cache-bitmap
*/
class LruBitmapCache : LruCache<String, Bitmap>(runtimeMemoryChunkInBytes) {
@kibotu
kibotu / ParallaxScreen.kt
Created June 1, 2022 08:41 — forked from surajsau/ParallaxScreen.kt
Parallax effect with Jetpack Compose
View ParallaxScreen.kt
@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()
@kibotu
kibotu / gource_me.sh
Last active May 25, 2022 14:43
gource & ffmpeg
View gource_me.sh
#!/bin/bash
# https://github.com/acaudwell/Gource
# brew install gource
# brew install ffmpeg
cd "/Users/user/Documents/repositories/my-favorite-project"
gource \
@kibotu
kibotu / extract_app_version.sh
Last active January 29, 2024 13:15
extract_app_version.sh
View extract_app_version.sh
#!/bin/bash
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Check if -man option is passed
if [ -f "version-properties.gradle" ]; then
APP_VERSION_RAW=$(grep "appVersion *=" version-properties.gradle)
else