Skip to content

Instantly share code, notes, and snippets.

View humazed's full-sized avatar

Ibrahim Eid humazed

View GitHub Profile
import {
ElementRef,
ForwardRefExoticComponent,
createElement,
forwardRef,
} from "react";
import { cn } from "./utils";
export function extend<T extends { className?: string }>(
Component: ForwardRefExoticComponent<T>,
@humazed
humazed / cleanup_all_projects.ps1
Last active July 2, 2024 06:12
powershell script for cleaning up build files in all Flutter and Android projects
Write-Host "Cleaning up build files in all Flutter and Android projects..."
$rootPath = Get-Location
Get-ChildItem -Path $rootPath -Recurse -Directory | ForEach-Object {
$currentDir = $_
$flutterProject = Join-Path $currentDir.FullName "pubspec.yaml"
$androidProject = Join-Path $currentDir.FullName "android\gradlew"
if (Test-Path $flutterProject) {
@LouisCAD
LouisCAD / ModalBottomSheet.kt
Last active November 20, 2023 09:16
Put this in its own Gradle module to have ModalBottomSheet in Material3 (or even without Material Design at all).
package com.louiscad.splitties.eap.bottomsheet
import android.app.Activity
import android.view.ViewGroup
import androidx.activity.compose.BackHandler
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetLayout
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
@slightfoot
slightfoot / anchor_scroll.dart
Last active January 27, 2021 00:28
Ever wanted to scroll down to a widget in a scroll view? Now you can, Anchor Scroll to the rescue! - by Simon Lightfoot - 15/11/2019
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@rodydavis
rodydavis / flutter_web_github_workflow.yml
Last active June 19, 2022 11:15
Build and Deploy Flutter Website to Flirebase Hosting
name: Build and Deploy Website
on: push
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
@bleeding182
bleeding182 / Babelfish.java
Last active September 15, 2018 10:19
Resolve app Localization
package com.davidmedenjak.babel;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.LocaleList;
import android.support.annotation.NonNull;
import android.support.v4.os.LocaleListCompat;
@omidraha
omidraha / GridAutoFitLayoutManager.java
Last active May 26, 2020 17:11
RecyclerView GridLayoutManager, auto-detect span count
// https://stackoverflow.com/a/30256880/538284
// https://stackoverflow.com/a/42241730/538284
// https://stackoverflow.com/a/38082715/538284
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
public class GridAutoFitLayoutManager extends GridLayoutManager {
@stkent
stkent / android-bluetooth-low-energy-resources.md
Last active November 16, 2025 19:16
Android Bluetooth Low Energy (BLE) Resources
@JakeWharton
JakeWharton / build.gradle
Created March 29, 2015 06:34
A Gradle task for installing all application variants at once. Placed in the public domain.
def installAll = tasks.create('installAll')
installAll.description = 'Install all applications.'
android.applicationVariants.all { variant ->
installAll.dependsOn(variant.install)
// Ensure we end up in the same group as the other install tasks.
installAll.group = variant.install.group
}