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 / 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))
@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