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 / check_dagger_consistency.py
Last active August 18, 2025 10:07
Check if there is a @Inject constructor without a provide function being used.
#!/usr/bin/env python3
import os
import re
import sys
from pathlib import Path
from typing import Set, List, Tuple
from dataclasses import dataclass
@dataclass
class InjectClass:
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
@kibotu
kibotu / clean.py
Last active August 11, 2025 09:30
Comprehensive MacOS App Cleanup Script
#!/usr/bin/env python3
import subprocess
import shutil
import os
import argparse
from pathlib import Path
# Global dry run flag
DRY_RUN = False
@kibotu
kibotu / migrate_to_core_13.py
Last active May 30, 2025 12:45
Migration script for sp android core 13 changes.
import os
import subprocess
from typing import Dict, Set
import re
# Constants
EVENTS_MODULE = "mover"
def checkout_core_repo() -> str:
"""Clone and checkout the core repository with shallow clone (no history), return its path"""
@kibotu
kibotu / extract-proguard-rules.sh
Last active May 16, 2025 09:16
Consumer ProGuard Rules Report
#!/bin/bash
# Extract consumer ProGuard rules from all dependencies and generate an HTML report
# Author: Jan Rabe
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
@kibotu
kibotu / SharedPreferenceDelegate.kt
Created May 13, 2025 06:47
Advanced android kotlin shared preference delegate.
import android.content.SharedPreferences
import androidx.core.content.edit
import de.check24.android.plugin.profis.events.shared.logger.EventsLogger
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
/**
* A type-safe SharedPreferences delegate with enhanced features:
@kibotu
kibotu / reclaim_build_folder.sh
Created March 14, 2025 10:00
Reclaims build folder in a directory. Ignores git folder, too and adds a summary.
import os
import shutil
import argparse
def get_dir_size(dir_path):
"""Calculate the total size of a directory in bytes."""
total_size = 0
for dirpath, dirnames, filenames in os.walk(dir_path):
for filename in filenames:
file_path = os.path.join(dirpath, filename)
import android.R
import android.app.Activity
import android.graphics.Rect
import android.view.View
import android.view.ViewTreeObserver
import android.widget.FrameLayout
class AndroidBug5497Workaround private constructor(activity: Activity) {
private val mChildOfContent: View
@kibotu
kibotu / ThreadsWatchdog.kt
Created March 11, 2025 12:39
Threads Watchdog
class ThreadsWatchDogInitializer: Initializer<Unit> {
@Inject lateinit var threads : ThreadsRepository
override fun create(context: Context) {
C24CoreApplication.inject(this)
threads.start()
}