Skip to content

Instantly share code, notes, and snippets.

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

Milad Atef MiladAtef

🏠
Working from home
View GitHub Profile
@MiladAtef
MiladAtef / pre-commit
Last active September 20, 2025 21:47
Automate your Flutter/Dart code quality workflow with this pre-commit Git hook. It automatically formats, fixes, and analyzes your staged code before each commit, ensuring your codebase remains clean, consistent, and error-free.
#!/bin/sh
# Get all staged files
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
# Filter for just the Dart files
DART_FILES=$(echo "$STAGED_FILES" | grep -E "\\.dart$")
# Check if Dart is installed before proceeding
if ! command -v dart &> /dev/null
#!/bin/bash
# Update Gradle, Java and other Android project settings in a Flutter project
# See: https://gradle.org/releases/
GRADLE_VERSION="8.13"
# Build errors often show the required Java version
JAVA_VERSION="17"
# See: https://developer.android.com/ndk/downloads
@MiladAtef
MiladAtef / update-android-project.sh
Created April 5, 2025 09:13 — forked from bizz84/update-android-project.sh
Script to update Gradle, Java and other Android project settings in a Flutter project
#!/bin/bash
# Update Gradle, Java and other Android project settings in a Flutter project
# See: https://gradle.org/releases/
DESIRED_GRADLE_VERSION="8.9"
# Build errors often show the required Java version
DESIRED_JAVA_VERSION="17"
# See: https://developer.android.com/ndk/downloads
DESIRED_NDK_VERSION="27.0.12077973"
# The minimum Android SDK version
@MiladAtef
MiladAtef / flutter_cleaner.ps1
Created May 12, 2024 10:31
Simple yet powerful script for cleaning all of your dart and flutter projects, to save up some space on your machine.
# To run, open PowerShell and execute: .\flutter_cleaner.ps1
Write-Host "Looking for projects... (may take a while)"
Get-ChildItem -Path . -Filter pubspec.yaml -Recurse -File | ForEach-Object {
Write-Host "Cleaning all projects..."
$dir = Split-Path -Parent $_.FullName
Write-Host "Cleaning ${dir}..."
Set-Location -Path $dir
flutter clean | Out-Null
@MiladAtef
MiladAtef / ohmyposhv3-v2.json
Created February 7, 2022 04:03 — forked from shanselman/ohmyposhv3-v2.json
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,