Skip to content

Instantly share code, notes, and snippets.

View SamadiPour's full-sized avatar
❤️
Love Coding

Amir Hossein SamadiPour

❤️
Love Coding
View GitHub Profile
@ItsBenyaamin
ItsBenyaamin / NetworkHelper.kt
Last active August 23, 2022 18:26
a singleton class to check the network connection state, use both of the NetworkCallback and ConnectivityManager to support older devices
package com.graymind75
import android.content.Context
import android.net.*
import android.os.Build
import androidx.annotation.RequiresApi
/**
* singleton class to check the network connection state
* It's use the old ConnectivityManager.activeNetworkInfo way for pre LOLLIPOP
@lukepighetti
lukepighetti / unused_dependencies.js
Created September 4, 2020 14:26
Search a Flutter project for unused dependencies
/// Finds unused dependencies from pubspec.yaml
///
/// Achieves this by parsing pubspec.yaml and recursively
/// searching the lib folder for an import statement that
/// contains the name of each package. Prints out the results.
const fs = require("fs");
const YAML = require("yaml");
const { execSync } = require("child_process");
/// Read pubspec.yaml