Skip to content

Instantly share code, notes, and snippets.

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

Prabhat Pandey prabhatsdp

🏠
Working from home
View GitHub Profile
@prabhatsdp
prabhatsdp / flurry-cli.zsh
Created February 27, 2026 11:31
Project-agnostic Flutter CLI (Zsh): standardizes flutter run and flutter build with UAT/PROD selection, flavor mapping, optional DEV_TOOLS dart-define, debug/release mode, interactive -a prompts, clear emoji logging, and forwarding of extra Flutter arguments (device, no-codesign, target file, etc.).
# ============================================================================
# Flurry CLI for Flutter (Zsh)
# ----------------------------------------------------------------------------
# A small, friendly CLI wrapper around `flutter run` and `flutter build` that:
# ✅ Keeps ENV and Flutter flavor in sync (UAT <-> uat, PROD <-> prod)
# ✅ Supports interactive mode (-a / --ask)
# ✅ Enables DEV_TOOLS only when explicitly requested (--dev)
# ✅ Defaults safely (UAT + debug) with clear logs
# ✅ Forwards extra args to Flutter commands (device, no-codesign, etc.)
#
@prabhatsdp
prabhatsdp / android_drawable_exporter.py
Created August 17, 2024 14:03
This Script can export Android Drawables with folders to import cumulatively at once using Android Studio's Import Drawables option. Script supports creation of drawables from PNG and SVG files currently.
import argparse
import os
from PIL import Image
import cairosvg
# Supported extensions
SUPPORTED_EXTENSIONS = ['.png', '.svg']
# Dictionary to store the multipliers for density suffixes
density_multipliers = {
@prabhatsdp
prabhatsdp / android_drawable_resizer.py
Created February 6, 2024 14:37
Python script to resize 4x PNG image to multi density for Android.
import argparse
from PIL import Image
import os
# Create a dictionary to store the multipliers for density suffixes
density_multipliers = {
'-ldpi': 0.75,
'-mdpi': 1.0,
'-hdpi': 1.5,
'-xhdpi': 2.0,
@prabhatsdp
prabhatsdp / ViewShowHideWithTransition.kt
Created March 22, 2023 08:36
View visibility change with transition. It uses TransitionManger.beginDelayedTransition to acheive the transition.
package dev.prabhatpandey.android.utils
import android.transition.ChangeBounds
import android.transition.Fade
import android.transition.Transition
import android.transition.TransitionManager
import android.transition.TransitionSet
import android.view.View
import android.view.ViewGroup
@prabhatsdp
prabhatsdp / view_pager_auto_scroll.kt
Created February 24, 2022 08:10
ViewPager auto scroll logic
// before onCreate() in acivity/fragment
private val mainHandler = Handler(Looper.getMainLooper())
private val updateBannerItemTask = object : Runnable {
override fun run() {
updateCurrentBannerItem()
mainHandler.postDelayed(this, 3000)
}