Skip to content

Instantly share code, notes, and snippets.

View suwardhana's full-sized avatar
🍀
I'm the Luckiest

Suwardhana suwardhana

🍀
I'm the Luckiest
View GitHub Profile
@suwardhana
suwardhana / monitor_device_connected.sh
Created February 15, 2026 04:42
auto launch scrcpy on android device connect
#!/bin/bash
export PATH="/Users/suwardhana/Library/Android/sdk/platform-tools:$PATH"
ADB="/Users/suwardhana/Library/Android/sdk/platform-tools/adb"
SCRCPY="/usr/local/bin/scrcpy"
LOG="/tmp/monitor-android.log"
echo "Starting Android device monitor..." >> "$LOG"
@suwardhana
suwardhana / export-docebase.ps1
Last active January 2, 2025 04:26
script for export small codebase as txt file
#how to use .\Export-Codebase.ps1 "C:\Path\To\Your\Codebase" "allcodebase.txt"
param (
[string]$RootPath, # Parameter 1: Root directory of the codebase
[string]$OutputFile # Parameter 2: Output filename
)
# Check if the root directory exists
if (-Not (Test-Path -Path $RootPath)) {
Write-Host "Error: The specified root directory does not exist."
exit
@suwardhana
suwardhana / retry_brew.sh
Created October 18, 2024 01:36
retry_brew for automatically retry connection reset when install use by ./retry_brew.sh (package_name)
#!/bin/bash
MAX_RETRIES=5
COUNT=0
PACKAGE_NAME=$1
while [ $COUNT -lt $MAX_RETRIES ]; do
brew install $PACKAGE_NAME && break
COUNT=$((COUNT+1))